[bugfix] 이름 수정 #6
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: CI | |
on: | |
push: | |
env: | |
DOCKER_IMAGE_NAME: rowlaw_docker_image | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# 빌드 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: | | |
yarn | |
yarn build | |
# 도커 이미지를 만들고 도커 허브에 업로드 | |
- name: Build and Push Docker Image | |
uses: mr-smithers-excellent/docker-build-push@v6 | |
with: | |
image: ${{ env.DOCKER_IMAGE_NAME }} | |
tags: ${{ github.ref_name }} | |
registry: docker.io | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# https://github.com/potenday-project/308_013_FE 리포지토리의 디플로이먼트 yaml 버전 업데이트 | |
update-manifest: | |
needs: build-image | |
runs-on: ubuntu-latest | |
env: | |
AUTHOR_NAME: ${{ vars.AUTHOR_NAME }} | |
AUTHOR_EMAIL: ${{ vars.AUTHOR_EMAIL }} | |
MANIFEST_FILE: ${{ vars.MANIFEST_FILE }} | |
MANIFEST_REPOSITORY: ${{ vars.MANIFEST_REPOSITORY }} | |
steps: | |
- name: Checkout Argocd Repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.MANIFEST_REPOSITORY }} | |
token: ${{ secrets.GIT_HUB_TOKEN }} | |
- name: Set Image Tag | |
run: | | |
yq -i '.spec.template.spec.containers[0].image = strenv(DOCKER_IMAGE_NAME) + ":${{ github.ref_name }}" ' ${{ env.MANIFEST_FILE }} | |
- name: Commit Changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: ${{ env.AUTHOR_NAME }} | |
author_email: ${{ env.AUTHOR_EMAIL }} | |
add: ${{ env.MANIFEST_FILE }} | |
message: 'Update image tag to ${{ github.ref_name }}' | |
- name: Push Changes | |
uses: ad-m/[email protected] | |
with: | |
repository: ${{ env.MANIFEST_REPOSITORY }} | |
branch: main | |
github_token: ${{ secrets.GIT_HUB_TOKEN }} |