From 6c3f0bf0b6d98dcd5edad2ad197ea0a34386ddfa Mon Sep 17 00:00:00 2001 From: Jordan Potter Date: Sun, 8 Aug 2021 20:23:31 -0500 Subject: [PATCH] Add GitHub workflow for publishing to Docker Hub --- .github/workflows/publish.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..338fce3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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