update to node 22 #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Running npm install and installing gulp | |
| run: | | |
| cd web | |
| npm install | |
| - name: Running build | |
| run: | | |
| cd web | |
| npm run build | |
| check-secret: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| deploy-secrets: ${{ steps.deploy-secrets.outputs.defined }} | |
| steps: | |
| - id: deploy-secrets | |
| if: "${{ env.DEPLOY_SECRETS != '' }}" | |
| run: echo "::set-output name=defined::true" | |
| env: | |
| MY_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| deploy: | |
| needs: check-secret | |
| runs-on: ubuntu-latest | |
| if: needs.check-secret.outputs.deploy-secrets == 'true' | |
| steps: | |
| - name: S3 Sync | |
| uses: jakejarvis/[email protected] | |
| with: | |
| args: --delete --exclude 'scss/*' --exclude 'node_modules/*' --exclude package.json --exclude package-lock.json --exclude requirements.txt --exclude gulpfile.js | |
| env: | |
| AWS_S3_BUCKET: <s3-bucket> | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: <region> | |
| SOURCE_DIR: web/dist | |
| - name: Invalidate Cloudfront | |
| uses: chetan/invalidate-cloudfront-action@v2 | |
| env: | |
| DISTRIBUTION: <cloudfront-dist-id> | |
| PATHS: '/*' | |
| AWS_REGION: <region> | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |