Skip to content

Commit

Permalink
ci: configure release actions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bandantonio committed Apr 30, 2022
1 parent d90c8a9 commit 631df77
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/antmarky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -105,4 +120,12 @@ jobs:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
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 }}

0 comments on commit 631df77

Please sign in to comment.