Add GitHub workflow for publishing to Docker Hub
This commit is contained in:
parent
e784c77dd9
commit
6c3f0bf0b6
1 changed files with 42 additions and 0 deletions
42
.github/workflows/publish.yml
vendored
Normal file
42
.github/workflows/publish.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
name: Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
name: Publish
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Get metadata for Docker image
|
||||||
|
id: docker-metadata
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: jordanpotter/wireguard
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
|
||||||
|
- name: Log into Docker Hub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: jordanpotter
|
||||||
|
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
tags: ${{ steps.docker-metadata.outputs.tags }}
|
||||||
|
labels: ${{ steps.docker-metadata.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
Loading…
Reference in a new issue