Skip to content

Commit

Permalink
Add CD-prod.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Aokijiop committed May 20, 2024
1 parent 278b0db commit 27b0e15
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/CD-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: S3 Deploy
on:
push:
branches:
- main
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }}
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }}
VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }}
VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }}
VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }}
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }}
VITE_BACKEND_HOST: ${{ secrets.PROD_VITE_BACKEND_HOST }}
# …and any additional environment variables

jobs:
run:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Build
uses: borales/actions-yarn@v4
with:
cmd: build

- name: Deploy
uses: reggionick/s3-deploy@v4
with:
folder: dist
bucket: ${{ secrets.PROD_S3_BUCKET }}
bucket-region: ${{ secrets.S3_BUCKET_REGION }}
dist-id: ${{ secrets.PROD_CLOUDFRONT_DISTRIBUTION_ID }}
invalidation: /
delete-removed: true
no-cache: true
private: true
filesToInclude: '.*/*,*/*,**'

0 comments on commit 27b0e15

Please sign in to comment.