From 4f7d845bcf3a518edeaf2459a76eb26eb7827114 Mon Sep 17 00:00:00 2001 From: Jafner <40403594+Jafner@users.noreply.github.com> Date: Sun, 1 Aug 2021 10:52:36 -0700 Subject: [PATCH] Added automated push to Dockerhub --- .github/workflows/main.yml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b675325..7f83347 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,12 +15,29 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + push_to_registry: + name: Build and push Docker image to Docker Hub runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Build and push Docker images - uses: docker/build-push-action@v2.6.1 + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log into Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: jafner/5etools-docker + + - name: Build and push the Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}