diff --git a/.github/workflows/dockerhub-publish.yml b/.github/workflows/dockerhub-publish.yml new file mode 100644 index 0000000..3d54f70 --- /dev/null +++ b/.github/workflows/dockerhub-publish.yml @@ -0,0 +1,34 @@ +name: Publish semver tags to DockerHub +on: + push: + tags: ["v*.*.*"] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: jrotter/bloblo + tags: | + type=semver,pattern={{version}} + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/go-semantic-release.yml b/.github/workflows/go-semantic-release.yml index 49961e2..0d54900 100644 --- a/.github/workflows/go-semantic-release.yml +++ b/.github/workflows/go-semantic-release.yml @@ -8,7 +8,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: go-semantic-release/action@v1 with: github-token: ${{ secrets.BOT_GITHUB_TOKEN }}