From 97a91f935058030c4bbf818cccd512f5b4fd4bf1 Mon Sep 17 00:00:00 2001 From: aluvare Date: Tue, 13 Dec 2022 13:38:24 +0100 Subject: [PATCH] buildx --- .github/workflows/build_deploy.yml | 33 ------------------- .github/workflows/docker-build.yml | 52 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/build_deploy.yml create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml deleted file mode 100644 index 1d9aaf1..0000000 --- a/.github/workflows/build_deploy.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Publish Docker image -on: - release: - types: [published] -jobs: - push_to_registry: - name: Push Docker image to GitHub Packages - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - lfs: true - - name: Checkout LFS objects - run: git lfs checkout - - name: Docker meta - id: docker_meta - uses: crazy-max/ghaction-docker-meta@v1 - with: - images: ghcr.io/aluvare/vnc-recorder/vnc-recorder - tag-sha: true - tag-semver: | - {{major}}.{{minor}}s - - name: Push to GitHub Packages - uses: docker/build-push-action@v1 - with: - path: . - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - registry: ghcr.io - repository: aluvare/vnc-recorder/vnc-recorder - tag_with_ref: true diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..cc489bb --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,52 @@ +name: Publish Docker image +on: + release: + types: [published] +jobs: + push_to_registry: + name: Push Docker image to GitHub Packages + runs-on: ubuntu-latest + steps: + - name: Install QEMU + uses: docker/setup-qemu-action@v1 + - name: Install Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Check out the repo + uses: actions/checkout@v2 + with: + lfs: true + - name: Checkout LFS objects + run: git lfs checkout + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: ghcr.io/aluvare/vnc-recorder/vnc-recorder + tag-sha: true + # Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Push to GitHub Packages + uses: docker/build-push-action@v2 + with: + file: ./Dockerfile + context: . + platforms: linux/amd64,linux/arm64/v8 + push: "${{ github.event_name != 'pull_request' }}" + tags: "${{ steps.meta.outputs.tags }}" + labels: "${{ steps.meta.outputs.labels }}"