diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..d3065eb --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,25 @@ +name: Push to Docker Hub + +on: + push: + branches: [ "main" ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true # <- BELANGRIJK: staat nu op 'true' + tags: ${{ secrets.DOCKERHUB_USERNAME }}/:latest