From 6f3320edbcbf8530dd0810995f5925b322b3d799 Mon Sep 17 00:00:00 2001 From: milesial Date: Wed, 18 Aug 2021 00:19:59 +0200 Subject: [PATCH] Add action Former-commit-id: 30c4e6a69c339ed456c912f56af6a05f8090d357 --- .github/workflows/main.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b8a6d66 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: Publish Docker image + +on: + push: + branches: master + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: milesial + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3 + with: + images: milesial/unet + + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}