From 9dc7f66d2e672c89c52d1960b9267b5e656e9330 Mon Sep 17 00:00:00 2001 From: laigasus Date: Thu, 21 Nov 2024 21:18:18 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20CI=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 다음의 역할을 수행함 - release 태그 버저닝 - 이미지 생성 자동화 --- .github/workflows/release-automation.yml | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/release-automation.yml diff --git a/.github/workflows/release-automation.yml b/.github/workflows/release-automation.yml new file mode 100644 index 0000000..ced1280 --- /dev/null +++ b/.github/workflows/release-automation.yml @@ -0,0 +1,51 @@ +name: release images using semantic tag versioning + +on: + push: + branches: [ main, develop ] + +jobs: + setup-build-deploy: + name: Setup, Build, and Deploy + runs-on: ubuntu-latest + permissions: + packages: write + contents: write + id-token: write + + steps: + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} + + - name: Source Code Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ghcr.io/${{ github.repository }}:${{ steps.tag_version.outputs.new_tag }} + ghcr.io/${{ github.repository }}:latest \ No newline at end of file