Skip to content

Commit

Permalink
chore: add temporary deploy cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
kcwww committed Apr 19, 2024
1 parent 8b5c4f4 commit bc70ece
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/tempFrontDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This is a basic workflow to help you get started with Actions

name: FrontEnd deploy

# Controls when the workflow will run
on:
push:
branches: ["FE/noBE"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Check Node v
run: node -v

- name: Install dependencies
working-directory: ./front
run: npm install

- name: Generate build
working-directory: ./front
run: npm run build

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Upload to S3
run: |
aws s3 sync \
./front/dist s3://snowball-ssock --delete
- name: CloudFront Invalidation
env:
CLOUD_FRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID}}
run: |
aws cloudfront create-invalidation \
--distribution-id $CLOUD_FRONT_ID --paths '/*'

0 comments on commit bc70ece

Please sign in to comment.