Skip to content

Commit

Permalink
Feat/#50 auto deploy (#51)
Browse files Browse the repository at this point in the history
* feat: ci cd 테스트

* feat: ci cd 테스트

* feat: cicd test

* feat: cicd test 2

* feat: cicd test 3

* feat: cicd test4

* feat: cicd test5

* feat: cicd 완성
  • Loading branch information
birdieHyun authored Oct 25, 2023
1 parent 7816dd3 commit b37d79b
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/front-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Deploy to CloudFront

on:
push:
branches: [ "main" ]


jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build project
run: |
cd vue3-yonsei-golf
yarn install
yarn build
- name: Set .env file
run: |
cd vue3-yonsei-golf
touch .env
echo "${{ secrets.VUE_SECRETS }}" > .env
- 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: ${{ secrets.AWS_REGION }}

- name: Upload to S3 test
run: |
aws s3 sync ./vue3-yonsei-golf/dist/ s3://${{ secrets.S3_BUCKET_NAME }} --region ${{ secrets.AWS_REGION }}
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"
40 changes: 40 additions & 0 deletions vue3-yonsei-golf/.github/workflows/front-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy to CloudFront

on:
push:
branches:
- feat/#50-auto-deploy

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build project
run: |
yarn install
yarn build
- name: Set .env file
run: |
echo(pwd)
touch .env
echo "${{ secrets.VUE_SECRETS }}" > .env
- 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: ${{ secrets.AWS_REGION }}

- name: Upload to S3 test
run: |
aws s3 cp s3://${{ secrets.S3_BUCKET_NAME }} --delete --region ${{ secrets.AWS_REGION }}
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/*"

0 comments on commit b37d79b

Please sign in to comment.