This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
[All] feat: 데모데이3차 동글 서비스 배포 (#207) #3
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: CICD for Frontend Production | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'frontend/**' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: move to frontend path | |
run: | | |
cd ./frontend | |
- name: Create .env.production variable | |
run: | | |
cd ./frontend | |
touch .env.production | |
echo "BASE_URL=${{secrets.BASE_URL_PRODUCTION}}" >> .env.production | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./frontend | |
file: ./frontend/Dockerfile-prod | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/dong-gle-frontend-prod:latest | |
platforms: linux/arm64 | |
deploy: | |
needs: build | |
uses: ./.github/workflows/deploy-prod.yml | |
secrets: inherit |