S3에 대한 별도의 IAM유저를 생성했습니다. IAM에 대한 내용은 따로 다뤄야 할 것 같네요. (편리하지만 알아야 할께 많은 AWS입니다.)
3.
이렇게 S3에 대한 IAM유저가 별도로 만들어졌습니다. 해당 유저의 키값을 통해, github-action으로 코드를 deploy하여, main에 commit이 되는 경우, 자동으로 S3로 코드가 업데이트 될 것입니다.
해당 레포지토리에 main브랜치에 대한 변화가 있을시에, s3로 해당 소스 파일들을 업로드 할 수 있도록 합니다.
# This is a basic workflow to help you get started with Actions
name: resume-front-CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: main
pull_request:
branches: main
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-18.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout source code
uses: actions/checkout@master
# Runs a set of commands using the runners shell
- name: Code Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws s3 cp --recursive --region ap-northeast-2 . s3://suho-hompage