refactor: 컴포넌트 구조를 URL_MAP 기준으로 변경 #147
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Make .env file | |
run: | | |
echo "GENERATE_SOURCEMAP=${{ secrets.GENERATE_SOURCEMAP }}" >> .env | |
echo "PORT=${{ secrets.PORT }}" >> .env | |
echo "REACT_APP_SERVER_URL=${{ secrets.REACT_APP_SERVER_URL }}" >> .env | |
echo "NEXT_PUBLIC_FRONT_URL=${{ secrets.NEXT_PUBLIC_FRONT_URL }}" >> .env | |
echo "NEXT_PUBLIC_SERVER_URL=${{ secrets.NEXT_PUBLIC_SERVER_URL }}" >> .env | |
- name: Docker QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Docker buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Docker Login | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ghcr.io/${{ github.repository_owner }}/blog-front:latest | |
- name: Configure AWS credential | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: AWS Deploy push | |
run: | | |
aws deploy push \ | |
--application-name blog-front \ | |
--s3-location s3://${{ secrets.AWS_S3_BUCKET }}/blog-front-${{ github.sha }}.zip \ | |
--description "blog-front-${{ github.sha }}" \ | |
--source . | |
- name: AWS Deploy create | |
run: | | |
aws deploy create-deployment \ | |
--application-name blog-front \ | |
--deployment-config-name CodeDeployDefault.AllAtOnce \ | |
--deployment-group-name blog-front-code-deploy \ | |
--description "blog-front-${{ github.sha }}" \ | |
--s3-location bucket=${{ secrets.AWS_S3_BUCKET }},key=blog-front-${{ github.sha }}.zip,bundleType=zip \ | |
--file-exists-behavior OVERWRITE |