diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml new file mode 100644 index 0000000..99f8c4a --- /dev/null +++ b/.github/workflows/publish-image.yml @@ -0,0 +1,41 @@ +name: Publish Docker image + +on: + push: + branches: ["main"] + release: + types: [published] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Generate Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: fundwave/s3-mysql-backup-cron + tags: | + # type=ref,event=branch + type=sha,enable=true,prefix=sha-,format=short + # type=semver,pattern={{version}} + # type=semver,pattern={{major}}.{{minor}} + flavor: | + latest=true + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v2 + env: + DOCKER_BUILDKIT: 1 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file