Skip to content

Commit

Permalink
feat: ✨ deploy github action 추가
Browse files Browse the repository at this point in the history
- close #356
  • Loading branch information
jpham005 committed Oct 13, 2023
1 parent f59f1f9 commit 9f86a8e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy

on:
release:
types:
- published

jobs:
deploy:
name: Deploy
runs-on: ubuntu-22.04

environment: Production
env:
READ_PRIVATE_SUBMODULE_TOKEN: ${{ secrets.READ_PRIVATE_SUBMODULE_TOKEN }}

WORKING_DIRECTORY: ${{ vars.DEPLOY_WORKING_DIRECTORY }}

DEPLOY_FILENAME: ${{ vars.DEPLOY_FILENAME }}
S3_REGION: ${{ vars.S3_REGION }}

AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
submodules: true
token: ${{ env.READ_PRIVATE_SUBMODULE_TOKEN }}

- name: Install AWS cli
run: |
sudo apt-get update
sudo apt-get install awscli
- name: Deploy code to AWS S3
run: |
zip -r ${{ env.DEPLOY_FILENAME }} appspec.yml app env deploy-script
aws s3 cp ${{ env.DEPLOY_FILENAME }} s3://stat-ec2-app-code-deploy-bucket/${{ env.DEPLOY_FILENAME }} --region ${{ env.S3_REGION }}
working-directory: ${{ env.DEPLOY_WORKING_DIRECTORY }}

0 comments on commit 9f86a8e

Please sign in to comment.