feat : metatData #77
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: Build and Push | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to NCP Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ secrets.NCP_CONTAINER_REGISTRY }} | |
username: ${{ secrets.NCP_ACCESS_KEY }} | |
password: ${{ secrets.NCP_SECRET_KEY }} | |
- name: build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ secrets.NCP_CONTAINER_REGISTRY }}/nextjs-fe:${{ github.sha }} | |
cache-from: type=registry,ref=${{ secrets.NCP_CONTAINER_REGISTRY }}/nextjs-fe:${{ github.sha }} | |
cache-to: type=inline | |
- name: change docker image name | |
run: | | |
sed -i 's|image: k8s-registry-test.kr.ncr.ntruss.com/nextjs-fe:.*$|image: ${{ secrets.NCP_CONTAINER_REGISTRY }}/nextjs-fe:${{ github.sha }}|' fe/fe-deployment.yaml | |
git config --global user.name "${{ secrets.GIT_USERNAME }}" | |
git config --global user.email "${{ secrets.GIT_EMAIL }}" | |
git add fe | |
git status | |
git commit -m "change docker image name" | |
- name: Push changes to main branch # merge 내용들을 main 브랜치로 최종 push | |
uses: ad-m/github-push-action@master | |
with: | |
branch: main | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |