Skip to content

Merge pull request #255 from Garodden/feature/last #114

Merge pull request #255 from Garodden/feature/last

Merge pull request #255 from Garodden/feature/last #114

Workflow file for this run

name: Front Auto Deploy after push
on:
push:
branches:
- develop
env:
S3_BUCKET_NAME: thlee-content
AWS_REGION: ap-northeast-2
WORKING-DIRECTORY: ./src/front
jobs:
deploy:
name: Build, Deploy to S3 bucket
runs-on: [ubuntu-latest]
strategy:
matrix:
node-version: [20.11.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Npm install
run: npm install
working-directory: ${{ env.WORKING-DIRECTORY }}
- name: Build
run: npm run build
working-directory: ${{ env.WORKING-DIRECTORY }}
- name: Transfer to S3 for serving static
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ env.S3_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.AWS_REGION }}
SOURCE_DIR: "./src/front/dist"
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@master
env:
PATHS: '/*'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-2'
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_ID }}