From 836292dff9754520031ebf73915aac9ab03826dd Mon Sep 17 00:00:00 2001 From: POTIER Frederic Date: Tue, 20 Aug 2024 10:19:24 +0200 Subject: [PATCH] Add workflow to build Docker image on tags --- .github/workflows/build-release.yml | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build-release.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 00000000..9a13a3bd --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,41 @@ +name: Build release + +on: + release: + tags: + - 'v*' + types: + - created + +jobs: + build-release: + name: Build release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create image tags + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/scicatproject/landingpageserver + flavor: latest=false + tags: | + type=raw,value=stable + type=ref,event=tag + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ steps.meta.outputs.tags }}