From 41ea48688175a1c59bf033ed56f270fda9952dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:41:33 +0900 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E3=82=BF=E3=82=B0=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E6=99=82=E3=81=AEworkflow=E3=81=AE=E6=95=B4=E5=82=99=20(Misske?= =?UTF-8?q?yIO#542)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-beta.yml | 2 -- .github/workflows/docker-host.yml | 51 +++++++++++++++++++++++++++++++ .github/workflows/docker-io.yml | 2 +- 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docker-host.yml diff --git a/.github/workflows/docker-beta.yml b/.github/workflows/docker-beta.yml index b4ccd9253..ca497500b 100644 --- a/.github/workflows/docker-beta.yml +++ b/.github/workflows/docker-beta.yml @@ -4,8 +4,6 @@ on: push: branches: - beta - tags: - - "**" workflow_dispatch: jobs: diff --git a/.github/workflows/docker-host.yml b/.github/workflows/docker-host.yml new file mode 100644 index 000000000..40ac20b58 --- /dev/null +++ b/.github/workflows/docker-host.yml @@ -0,0 +1,51 @@ +name: Publish Docker image (host) + +on: + push: + branches: + - host + tags: + - '[0-9.]+-host.*' + workflow_dispatch: + +jobs: + push_to_registry: + name: Push Docker image to GitHub Container Registry + runs-on: ubuntu-22.04 + if: github.repository == 'MisskeyIO/misskey' + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/misskeyio/misskey + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Prepare image tags + run: | + echo "FORMATTED_BRANCH_NAME=$(echo ${{ github.ref_name }} | sed -e 's/\//-/g' )" >> $GITHUB_ENV + - name: Build and Push to GitHub Container Registry + uses: docker/build-push-action@v5 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + push: true + platforms: ${{ steps.buildx.outputs.platforms }} + provenance: false + labels: ${{ env.FORMATTED_BRANCH_NAME }} + cache-from: type=registry,ref=ghcr.io/misskeyio/misskey:host-buildcache + cache-to: type=registry,ref=ghcr.io/misskeyio/misskey:host-buildcache,mode=max + tags: | + ghcr.io/misskeyio/misskey:host + ghcr.io/misskeyio/misskey:${{ env.FORMATTED_BRANCH_NAME }} diff --git a/.github/workflows/docker-io.yml b/.github/workflows/docker-io.yml index aea2a00a4..4a2d038ea 100644 --- a/.github/workflows/docker-io.yml +++ b/.github/workflows/docker-io.yml @@ -5,7 +5,7 @@ on: branches: - io tags: - - "**" + - '[0-9.]+-io.*' workflow_dispatch: jobs: