From 631df776517ed7462e068cf3f790eee6c2a1b580 Mon Sep 17 00:00:00 2001 From: Antonio Date: Sat, 30 Apr 2022 14:51:05 +0300 Subject: [PATCH] ci: configure release actions This update includes: - tagged docker image release - auto-sync of README with description in docker hub - auto-creation of draft GitHub release on tag push --- .github/workflows/antmarky.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/antmarky.yml b/.github/workflows/antmarky.yml index bca5693..7340f1d 100644 --- a/.github/workflows/antmarky.yml +++ b/.github/workflows/antmarky.yml @@ -76,10 +76,24 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} + generate-release: + name: 📦 Generate GitHub Release + if: startsWith(github.ref, 'refs/tags/v') + needs: generate-docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Create a GitHub release + uses: softprops/action-gh-release@v1 + with: + body: 'This release was generated automatically. Full details will be available soon' + draft: true + build-docker-image: name: 🐋 Build and push Docker image needs: generate-docs - if: github.ref == 'refs/heads/main' + if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -90,8 +104,9 @@ jobs: with: images: bandantonio/antmarky tags: | - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} - + type=semver,pattern={{version}} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + - name: 🔑 Login to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v1 @@ -105,4 +120,12 @@ jobs: context: . push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.docker_meta.outputs.labels }} + + - name: 🐋 📝 DockerHub description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_ALT_TOKEN }} + repository: bandantonio/antmarky + short-description: ${{ github.event.repository.description }}