Deploy #2060
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: Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 */12 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Build | |
| run: | | |
| npm ci | |
| NODE_ENV=production npm run build | |
| - name: Deploy Fingerprinted Assets (Immutable) | |
| uses: jakejarvis/s3-sync-action@master | |
| with: | |
| args: --acl public-read --follow-symlinks --cache-control "public,max-age=31536000,immutable" | |
| env: | |
| DEST_DIR: '_next/static' | |
| SOURCE_DIR: 'out/_next/static' | |
| - name: Deploy Remaining Files (No Cache) | |
| uses: jakejarvis/s3-sync-action@master | |
| with: | |
| args: --acl public-read --follow-symlinks --delete --cache-control "public,max-age=0,must-revalidate" | |
| env: | |
| SOURCE_DIR: 'out' | |
| - name: Invalidate CloudFront | |
| run: | | |
| aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" | |
| env: | |
| AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: 'eu-central-1' | |
| NEXT_PUBLIC_SITE_URL: ${{ secrets.SITE_URL }} | |
| API_URL: ${{ secrets.API_URL }} | |
| NEXT_PUBLIC_API_URL: ${{ secrets.API_URL }} | |
| NEXT_PUBLIC_RECAPTCHA_SITE_KEY: ${{ secrets.RECAPTCHA_SITE_KEY }} | |
| NEXT_PUBLIC_FEEDBACK_FORM_HANDLER_URL: ${{ secrets.FEEDBACK_FORM_HANDLER_URL }} | |
| ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} |