From 91cfac8142102b0ce7a56c1ce1f4835b69ead602 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Fri, 3 Jan 2025 12:34:21 +0100 Subject: [PATCH] add publish workflow --- .github/workflows/publish.yaml | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..e77bb99 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,57 @@ +name: Publish + +on: + push: + branches: + - main + tags: + - 'v*.*.*' + +jobs: + publish-docker: + name: Build and push custom image + runs-on: ubuntu-20.04 + permissions: + contents: 'read' + id-token: 'write' + packages: 'write' + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/pluralsh/edge + docker.io/pluralsh/edge + tags: | + type=semver,pattern={{version}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker + uses: docker/login-action@v3 + with: + username: mjgpluralsh + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: "." + file: "./Dockerfile" + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + GIT_COMMIT=${{ github.sha }}