From c29b05b82cdc951c2356ff1d2921738b394223b4 Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Wed, 20 Dec 2023 15:03:10 +0100 Subject: [PATCH 1/4] add image ci workflow for github --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a8806af --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Create and publish a Docker image + +on: + push: + branches: + - main + release: + types: [published] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64,linux/arm64/v8 + target: production + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From ac9b5901633e5ee79e7fc934d250b466e203befe Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Wed, 20 Dec 2023 15:03:59 +0100 Subject: [PATCH 2/4] add test branch --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8806af..bc451cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,7 @@ on: push: branches: - main + - 145-add-image-ci-flow release: types: [published] From 3f5fbf2bbac1217b4aac62afc104a9abfbd898b2 Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Wed, 20 Dec 2023 15:13:59 +0100 Subject: [PATCH 3/4] remove arm --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc451cf..7c62ffd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,10 +33,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -53,7 +49,6 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v4 with: - platforms: linux/amd64,linux/arm64/v8 target: production push: true tags: ${{ steps.meta.outputs.tags }} From e1ee5e2f12701b6e909512eac614cc03294f77fa Mon Sep 17 00:00:00 2001 From: Jannik Streek Date: Wed, 20 Dec 2023 15:19:27 +0100 Subject: [PATCH 4/4] cleanup --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c62ffd..2511411 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,6 @@ on: push: branches: - main - - 145-add-image-ci-flow release: types: [published]