chore: yml 파일 호기심 탐구 막장편-ecr 사용하지 않기 #1
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: api-gateway CI/CD | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: CI | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
token: ${{ secrets.ACTION_TOKEN }} # personal token | |
- name: Docker build image | |
id: build-image | |
run: | | |
cd ~/api-gateway | |
docker build --platform linux/arm64 -t tscenping:api-gateway-image . | |
deploy: | |
needs: build | |
name: CD | |
runs-on: self-hosted | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Stop and remove previous container | |
run: | | |
cd ~/api-gateway | |
docker-compose down --rmi all | |
- name: Run container | |
continue-on-error: true | |
run: | | |
cd ~/api-gateway | |
docker-compose up -d | |