From a14d342571c3719aa95e3a2ad021ba8e204105b6 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 11 Apr 2024 13:53:56 +0200 Subject: [PATCH] first go at creating the build action --- .github/workflows/docker.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..5943e38 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,51 @@ +name: Build and Publish Docker Images +on: + push: + +jobs: + buildmatrix: + name: Create Build Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Set up matrix + id: set-matrix + run: | + echo "matrix=$(curl https://download.dokuwiki.org/version | jq -c 'del(.master) | {release: [.[]]}')" >> $GITHUB_OUTPUT + + build: + needs: buildmatrix + name: Build Docker Image ${{ matrix.release.date }} + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJson(needs.buildmatrix.outputs.matrix)}} + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: splitbrain + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64,linux/arm64,linux/386 + push: true + cache-from: type=gha, scope=${{ github.workflow }} + cache-to: type=gha, scope=${{ github.workflow }} + tags: | + dokuwiki/dokuwiki:${{ matrix.release.date }} + dokuwiki/dokuwiki:${{ matrix.release.type }} + build-args: | + BRANCH=${{ env.BRANCH }}