본문 바로가기

(링크)참고 사이트

CI/CD 참고 사이트

https://wookim789.tistory.com/39?category=990545 // 순서

 

AWS와 github을 이용한 CI/CD 적용하기 (1)

CI/CD Continuous Intergration 와 Contonuous Delivery 혹은 Continuous Deployment 지속적 통합과 지속적 배달 혹은 배포 www.redhat.com/ko/topics/devops/what-cicd-pipeline CI/CD 파이프라인이란? CI/CD 파..

wookim789.tistory.com

 

https://cheri.tistory.com/201

yml 작성 양식

 

Github actions을 이용한 AWS S3 자동배포

애플리케이션에 기능을 더할 때마다 또는 유지/보수할 때마다 빌드 및 배포하는 작업들이 불편하게 느껴지지 않았나요? 그렇다면 Github actions를 사용해보세요! Github Action이란? 이벤트 발생에 따

cheri.tistory.com

 

# release-deploy-work.yml
name: release

on:
    push:
        branches:
            - release # release 브랜치에서 push 이벤트가 일어났을 때 실행
    pull_request:
        branches:
            - release

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - name: Checkout source code
              uses: actions/checkout@master

            # 실행 속도를 빠르게 하기 위해 설치된 Node 모듈을 캐시하도록 설정합니다.
            - name: Generate Environment Variables File for Production # Github Repository Secrets를 통해 변수 파일을 생성
              run: 
                echo "REACT_APP_TOKENNAME=$REACT_APP_TOKENNAME" >> .env.production
              env: 
                REACT_APP_TOKENNAME: ${{ secrets.REACT_APP_TOKENNAME }}
            - name: Cache node modules
              uses: actions/cache@v2
              with:
                  path: ~/.npm
                  key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
                  restore-keys: |
                      ${{ runner.os }}-node-

            - name: Install Dependencies
              run: yarn

            - name: Build
              run: yarn build
              env:
                REACT_APP_TOKENNAME: ${{ secrets.REACT_APP_TOKENNAME }}
                CI: ""

            - name: Deploy
              env:
                  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_MANAGER_KEY_ID }}
                  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_MANAGER_SECRET_ACCESS_KEY }}
              run: |
                  aws s3 cp \
                  --recursive \
                  --region ap-northeast-2 \
                  build s3://사이트 도메인

파이썬 파일 이기 때문에 줄 유의!