From 3491c841c534e15efed8a2fa80572911900416d4 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 5 Apr 2022 01:50:25 +0700 Subject: [PATCH 1/2] Build and publish Docker image on tag --- .github/workflows/on-tag.yml | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/on-tag.yml diff --git a/.github/workflows/on-tag.yml b/.github/workflows/on-tag.yml new file mode 100644 index 0000000..431a659 --- /dev/null +++ b/.github/workflows/on-tag.yml @@ -0,0 +1,41 @@ +name: Build and publish Docker image on tag + +on: + push: + tags: + - 'v*.*.*' + +env: + DOCKER_CLI_EXPERIMENTAL: enabled + +jobs: + build: + name: Build Docker image + runs-on: ubuntu-18.04 + steps: + - name: Set VERSION + run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Login to Docker Hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Checkout project + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + id: qemu + + - name: Setup Docker buildx action + uses: docker/setup-buildx-action@v1 + id: buildx + + - name: Show available Docker buildx platforms + run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Run Docker buildx + run: | + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --tag ${{ secrets.DOCKER_HUB_USER }}/sensei:$VERSION \ + --push . From 9c841f29a59d04c0d2149bc4672b39e942e6b290 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 5 Apr 2022 01:50:37 +0700 Subject: [PATCH 2/2] Build Docker image on push --- .github/workflows/on-push.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/on-push.yml diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml new file mode 100644 index 0000000..e6060e5 --- /dev/null +++ b/.github/workflows/on-push.yml @@ -0,0 +1,32 @@ +name: Build Docker image on push + +on: push + +env: + DOCKER_CLI_EXPERIMENTAL: enabled + +jobs: + build: + name: Build Docker image + runs-on: ubuntu-18.04 + steps: + - name: Checkout project + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + id: qemu + + - name: Setup Docker buildx action + uses: docker/setup-buildx-action@v1 + id: buildx + + - name: Show available Docker buildx platforms + run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Run Docker buildx + run: | + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --tag sensei \ + .