github action to build docker image

This commit is contained in:
Andreas Gohr 2021-01-18 18:31:00 +01:00
parent 72c2822208
commit 4690037ef5
1 changed files with 39 additions and 0 deletions

39
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Publish Docker image
on:
push:
branches: [ master, stable, docker ]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
-
name: Check out the repo
uses: actions/checkout@v2
-
name: Set Branch Environment
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: splitbrain
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: ./docker
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/386
push: true
tags: splitbrain/dokuwiki:${{ env.BRANCH }}
build-args: |
BRANCH=${{ env.BRANCH }}