From ffb112888eeac8dd5d9a79044bf956836bfe1fad Mon Sep 17 00:00:00 2001 From: 5FeetUnder <15950507+5FeetUnder@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:37:15 +0200 Subject: [PATCH] Create build_old_version.yml the existing build.yml also pushes the "latest" tag with the built image. Since sometimes one might want to build an older version (e.g. for compatibility with other tools idk), I added another workflow to build without the "latest" tag --- .github/workflows/build_old_version.yml | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/build_old_version.yml diff --git a/.github/workflows/build_old_version.yml b/.github/workflows/build_old_version.yml new file mode 100644 index 0000000..afbfb00 --- /dev/null +++ b/.github/workflows/build_old_version.yml @@ -0,0 +1,67 @@ +name: "Build Docker Image without 'latest' tag" +run-name: Build arm64 Image for Focalboard ${{ inputs.release_tag }} +on: + workflow_dispatch: + inputs: + release_tag: + description: "Focalboard tag" + required: true + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.actor }}/focalboard-arm64 + PLATFORMS: | + linux/arm64 + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - + name: Get Focalboard Git Repo + uses: actions/checkout@v4.1.0 + with: + repository: 'mattermost/focalboard' + ref: ${{ inputs.release_tag }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: ${{ env.PLATFORMS }} + - + 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 }} + tags: | + type=semver,pattern={{raw}},value=${{ inputs.release_tag }} + type=semver,pattern={{version}},value=${{ inputs.release_tag }} + type=semver,pattern=v{{major}}.{{minor}},value=${{ inputs.release_tag }} + type=semver,pattern={{major}}.{{minor}},value=${{ inputs.release_tag }} + - + name: Build and push the image + uses: docker/build-push-action@v5 + with: + context: . + push: true + file: ./docker/Dockerfile + platforms: ${{ env.PLATFORMS }} + provenance: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}