From 8d146f6f5096a70f347511984522c6917b390cd9 Mon Sep 17 00:00:00 2001 From: Mia Winter Date: Mon, 19 Feb 2024 20:31:53 +0100 Subject: [PATCH] Added docker github action --- .github/workflows/docker.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..42304cf --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,38 @@ +name: Build, Tag, Push Docker Image + +on: + push: + branches: + - main + tags: [ v*, alpha-, beta- ] + +env: + IMAGE_NAME: miawinter/wave + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract metadata for the image + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + + - name: Log into the Container registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}