From aa82a34a676ee092ffb8f3c58faed0a0e40884b9 Mon Sep 17 00:00:00 2001 From: Oleg Kainov Date: Thu, 2 Jun 2022 23:28:00 +0200 Subject: [PATCH] ci: add Docker push action --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 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..9d947f2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +# This is a basic workflow to help you get started with Actions + +name: Push to Docker hub + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + release: + types: [published] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + push: + 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: okainov/mantisbt + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}