posterstrudel/.github/workflows/deploy-next.yml
Your Name 60f0ce5680
Some checks are pending
Docker image / build-and-push-image (push) Waiting to run
first commit
2024-09-17 18:11:55 -06:00

47 lines
1.0 KiB
YAML

name: Deploy Next Version
on:
push:
branches:
- next
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Redirect 404 to Index for SPA
run: cp dist/index.html dist/404.html
- name: Deploy
uses: reggionick/s3-deploy@v4
with:
folder: dist
bucket: "${{ secrets.S3_BUCKET }}"
bucket-region: us-east-1
dist-id: "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}"
invalidation: /
delete-removed: true
no-cache: true
private: true
files-to-include: "{.*/**,**}"