Skip to content

Commit

Permalink
chore(ci): fix the upload to S3 condition
Browse files Browse the repository at this point in the history
  • Loading branch information
pkorchak committed May 22, 2023
1 parent b0fdf1e commit 23b208e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ on:
branches: [ main ]

jobs:
init:
runs-on: ubuntu-latest
outputs:
env: ${{ steps.setEnv.outputs.env }}
steps:
- name: Set env variable
id: setEnv
run: |
if [[ "${{github.ref_name}}" == "main" ]]; then
echo "::set-output name=env::production"
else
echo "::set-output name=env::staging"
fi
build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -34,7 +48,7 @@ jobs:
env:
CI: true
- name: Upload to S3 bucket
if: ${{ github.branch == 'main' }}
if: github.ref_name == 'main'
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
Expand Down

0 comments on commit 23b208e

Please sign in to comment.