From 53a043d0213faa44089e698efa811054a9892d94 Mon Sep 17 00:00:00 2001 From: kitsuyui Date: Wed, 10 Aug 2022 06:13:46 +0900 Subject: [PATCH] Deploy to Docker Hub --- .github/workflows/docker-release.yml | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/docker-release.yml diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 00000000..296bd607 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + release: + # "released" events are emitted either when directly be released or be edited from pre-released. + types: [prereleased, released] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: kitsuyui/rendering-proxy + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + if: github.event_name == 'release' && !github.event.release.prerelease + with: + context: . + file: docker/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}