Skip to content

Commit

Permalink
chore: fix deployments (#10)
Browse files Browse the repository at this point in the history
Some secrets / variables were configured with the wrong name which is
fixed now.
Also some secrets were set as variables because they are non-sensitive.
I updated the workflow .yml files accordingly.
  • Loading branch information
larsrickert authored Jan 2, 2024
1 parent 405e3da commit 828e3ae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
16 changes: 8 additions & 8 deletions .github/templates/cf-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: Cloud Foundry Push
description: Pushes / Deploys an application to Cloud Foundry using CLI version 8

inputs:
cf-endpoint:
endpoint:
required: true
description: API endpoint of Cloud Foundry
cf-org:
org:
required: true
description: Name of the Cloud Foundry organization
cf-username:
username:
required: true
description: Username of the Cloud Foundry service account
cf-password:
password:
required: true
description: Password of the Cloud Foundry service account
cf-space:
space:
required: true
description: Space to push to (e.g. dev, prod etc.). A corresponding manifest with name "manifest-<space>.yml" is expected
working-directory:
Expand All @@ -35,11 +35,11 @@ runs:
- name: Login to Cloud Foundry
shell: bash
run: cf login -u "${{ inputs.cf-username }}" -p "${{ inputs.cf-password }}" -a "${{ inputs.cf-endpoint }}" -o "${{ inputs.cf-org }}" -s "${{ inputs.cf-space }}"
run: cf login -u "${{ inputs.username }}" -p "${{ inputs.password }}" -a "${{ inputs.endpoint }}" -o "${{ inputs.org }}" -s "${{ inputs.space }}"

- name: Deploy (${{ inputs.cf-space }})
- name: Deploy (${{ inputs.space }})
shell: bash
run: cf push --manifest "./manifest-${{ inputs.cf-space }}.yml" --strategy rolling
run: cf push --manifest "./manifest-${{ inputs.space }}.yml" --strategy rolling
working-directory: ${{ inputs.working-directory }}

- name: Logout from Cloud Foundry
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ on:
inputs:
stage:
description: Stage to deploy to
type: choice
type: environment
required: true
default: dev
options:
- "dev"

jobs:
build:
Expand Down Expand Up @@ -70,14 +68,14 @@ jobs:
- name: Deploy to Cloud Foundry
uses: ./.github/templates/cf-push
with:
cf-endpoint: ${{ secrets.CF_ENDPOINT }}
cf-org: ${{ secrets.CF_ORG }}
cf-username: ${{ secrets.CF_USERNAME }}
cf-password: ${{ secrets.CF_PASSWORD }}
endpoint: ${{ env.CF_ENDPOINT }}
org: ${{ env.CF_ORG }}
username: ${{ env.CF_USERNAME }}
password: ${{ secrets.CF_PASSWORD }}
# we need to define a fallback value here because the default for the input
# is only assigned when the workflow is triggered manually. When triggered e.g. on push
# the input will be unset so a fallback is needed here
cf-space: ${{ inputs.stage || 'dev' }}
space: ${{ inputs.stage || 'dev' }}
working-directory: packages/sit-onyx/.cloud-foundry

deploy_documentation:
Expand All @@ -97,12 +95,12 @@ jobs:
- name: Deploy to Cloud Foundry
uses: ./.github/templates/cf-push
with:
cf-endpoint: ${{ secrets.CF_ENDPOINT }}
cf-org: ${{ secrets.CF_ORG }}
cf-username: ${{ secrets.CF_USERNAME }}
cf-password: ${{ secrets.CF_PASSWORD }}
endpoint: ${{ env.CF_ENDPOINT }}
org: ${{ env.CF_ORG }}
username: ${{ env.CF_USERNAME }}
password: ${{ secrets.CF_PASSWORD }}
# we need to define a fallback value here because the default for the input
# is only assigned when the workflow is triggered manually. When triggered e.g. on push
# the input will be unset so a fallback is needed here
cf-space: ${{ inputs.stage || 'dev' }}
space: ${{ inputs.stage || 'dev' }}
working-directory: apps/docs/.cloud-foundry

0 comments on commit 828e3ae

Please sign in to comment.