Skip to content

Commit

Permalink
Try sharing variables between steps
Browse files Browse the repository at this point in the history
Toward #755.
  • Loading branch information
waldoj committed Dec 4, 2021
1 parent a232608 commit ed85b94
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ jobs:
with:
name: codebase
path: .
outputs:
github_branch: ${{ github.head_ref }}

deploy:
runs-on: ubuntu-18.04
needs: build # Don't deploy unless the build succeeds
env:
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_BRANCH: ${{ needs.build.outputs.github_branch }}
steps:
- name: Get the secret-populated code
uses: actions/download-artifact@v2
Expand All @@ -64,15 +67,15 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: us-east-1
- name: Staging CodeDeploy Deployment
if: ${{ GITHUB_BRANCH == 'master' }}
if: ${{ needs.build.outputs.github_branch == 'master' }}
run: |
aws deploy create-deployment \
--application-name RS-Web \
--deployment-group-name RS-Web-Staging \
--deployment-config-name CodeDeployDefault.OneAtATime \
--github-location repository=${{ github.repository }},commitId=${{ github.sha }}
- name: Production CodeDeploy Deployment
if: ${{ GITHUB_BRANCH == 'deploy' }}
if: ${{ needs.build.outputs.github_branch == 'deploy' }}
run: |
aws deploy create-deployment \
--application-name RS-Web \
Expand Down

0 comments on commit ed85b94

Please sign in to comment.