From dde39ab390b23b33169afc3ee4af84b49de21b32 Mon Sep 17 00:00:00 2001 From: Kitsuya0828 Date: Tue, 2 Apr 2024 14:50:41 +0900 Subject: [PATCH 1/4] feat: add image release github actions --- .github/workflows/release.yaml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6864031 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,39 @@ +name: Release +on: + push: + tags: + - "v*" +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - 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: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: go.mod + - name: Set tag + id: vars + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag }} From b1ee409fb06711821e8092f84b80d1d8f50f2f8e Mon Sep 17 00:00:00 2001 From: Kitsuya0828 Date: Tue, 2 Apr 2024 14:59:02 +0900 Subject: [PATCH 2/4] fix: image name --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6864031..6f551f1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,8 @@ jobs: release: name: Release runs-on: ubuntu-latest + env: + IMAGE_NAME: broom steps: - name: Checkout uses: actions/checkout@v4 From 01935f01a731238500a2b1a87af52623f01aa802 Mon Sep 17 00:00:00 2001 From: Kitsuya0828 Date: Tue, 2 Apr 2024 15:14:09 +0900 Subject: [PATCH 3/4] fix: test workflow on branch --- .github/workflows/release.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6f551f1..36db4f0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,8 +1,7 @@ name: Release on: - push: - tags: - - "v*" + pull_request: + jobs: release: name: Release @@ -38,4 +37,3 @@ jobs: push: true tags: | ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag }} From cb7d85f60d440a6f2ead9596dbf8bb1d4b1aedb8 Mon Sep 17 00:00:00 2001 From: Kitsuya0828 Date: Tue, 2 Apr 2024 15:18:24 +0900 Subject: [PATCH 4/4] revert: test workflow on branch This reverts commit 01935f01a731238500a2b1a87af52623f01aa802. --- .github/workflows/release.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 36db4f0..6f551f1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,7 +1,8 @@ name: Release on: - pull_request: - + push: + tags: + - "v*" jobs: release: name: Release @@ -37,3 +38,4 @@ jobs: push: true tags: | ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.tag }}