🌐 [Ci] action script 작성 #4
Workflow file for this run
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 Server Ci/Cd | |
on: | |
push: | |
branches: | |
- Ci/69 | |
- develop | |
paths: | |
# - 'apps/api/**' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: api-camon | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# - name: Login to NCP Container Registry | |
# uses: docker/login-action@v2 | |
# with: | |
# registry: ${{ secrets.NCLOUD_REGISTRY_ID }} | |
# username: ${{ secrets.NCP_ACCESS_KEY }} | |
# password: ${{ secrets.NCP_SECRET_KEY }} | |
- name: Log in to Ncloud Container Registry | |
run: | | |
echo ${{ secrets.NCLOUD_REGISTRY_PASSWORD }} | docker login -u ${{ secrets.NCLOUD_REGISTRY_USERNAME }} ${{ secrets.NCLOUD_REGISTRY_URL }} --password-stdin | |
- name: Build Docker image | |
run: | | |
docker build -t ${{ secrets.NCLOUD_REGISTRY_ID }}/$IMAGE_NAME:latest ./apps/api | |
- name: Push to Ncloud Container Registry | |
run: | | |
docker push ${{ secrets.NCLOUD_REGISTRY_ID }}/$IMAGE_NAME:latest | |