Skip to content

Commit

Permalink
Fix branch usage as variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kompotkot committed Dec 5, 2024
1 parent 90498b9 commit d53bc20
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/deploy_manual_branch_wb-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Extract branch name
- name: Show branch name
run: |
echo "BRANCH_NAME=${{ github.event.inputs.branch || github.event.pull_request.head.ref }}" >> $GITHUB_ENV
echo "Running manual deployment for ${BRANCH_NAME} branch"
echo "Running manual deployment for ${{ github.event.inputs.branch || github.event.pull_request.head.ref }} branch"
- name: Checkout repository and main branch
env:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
uses: actions/checkout@v2
with:
ref: ${BRANCH_NAME}
ref: ${{ github.event.inputs.branch || github.event.pull_request.head.ref }}

- name: Set up node.js
uses: actions/setup-node@v3
Expand All @@ -47,7 +44,6 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}
run: |
aws s3 sync ./dist ${{ secrets.AWS_FRONTEND_BUCKET_WB_DASHBOARD_BRANCH }}/${BRANCH_NAME} --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_WB_DASHBOARD_BRANCH }} --paths '/${BRANCH_NAME}/*'
aws s3 sync ./dist ${{ secrets.AWS_FRONTEND_BUCKET_WB_DASHBOARD_BRANCH }}/${{ github.event.inputs.branch || github.event.pull_request.head.ref }} --delete
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_WB_DASHBOARD_BRANCH }} --paths '/${{ github.event.inputs.branch || github.event.pull_request.head.ref }}/*'

0 comments on commit d53bc20

Please sign in to comment.