From c05899b1f2a4610db9900fa31c7845eea35ffdf7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 9 Aug 2022 03:24:51 +0200 Subject: [PATCH] Add automated release actions workflow --- .github/workflows/docker.yml | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 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..aecc30a --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,57 @@ +name: "Automated release" + +on: + push: + tags: + - "v*" + +jobs: + publish-docker: + name: "🐳 Build and publish Docker image on ghcr.io" + runs-on: ubuntu-latest + needs: + - "tests" + - "build-package" + steps: + - name: "Checkout repository" + uses: actions/checkout@v2 + + - name: "❓ Find the release semantic version" + id: semver + uses: Steffo99/actions-semver@v0.3.4 + with: + string: ${{ github.ref_name }} + + - name: "🔨 Setup Buildx" + uses: docker/setup-buildx-action@v2 + + - name: "🔑 Login to GitHub Containers" + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: "🔽 Find the lowercase name of the repository" + id: reponame + uses: ASzc/change-string-case-action@v2 + with: + string: ${{ github.repository }} + + - name: "🏗 Build and push the Docker image" + uses: docker/build-push-action@v3 + with: + target: "telegram" + tags: >- + ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.precedence }}, + ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.core }}, + ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.pair }}, + ghcr.io/${{ steps.reponame.outputs.lowercase }}:${{ steps.semver.outputs.major }}, + ghcr.io/${{ steps.reponame.outputs.lowercase }}:latest + push: true + + - name: "🌐 Create release" + uses: ncipollo/release-action@v1.10.0 + with: + draft: true + generateReleaseNotes: true