ci: fix cog configuration for GitHub #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: read | |
checks: read | |
jobs: | |
deploy: | |
name: Deploy on DockerHub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
- run: | | |
export IMAGE="${{ secrets.DOCKER_REGISTRY_USERNAME }}/$(make image-name)" | |
make docker | |
docker push "${IMAGE}:$(make image-tag)" | |
docker tag "${IMAGE}:$(make image-tag)" "${IMAGE}:latest" | |
docker push "${IMAGE}:latest" | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: deploy | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Install Cocogitto | |
uses: cocogitto/cocogitto-action@v3 | |
with: | |
release: false | |
check: false | |
git-user: 'github-actions[bot]' | |
git-user-email: 'github-actions@github.com' | |
- name: Bump version | |
run: | | |
export TAG="" | |
export VERSION="" | |
VERSION="$(make image-tag)" | |
cog bump --version "${VERSION}" | |
cog changelog --at "v${VERSION}" > tmp.md | |
- name: Push back to repository | |
run: | | |
git config user.email "github-actions@github.com" | |
git config user.name "github-actions[bot]" | |
git push | |
- uses: softprops/action-gh-release@v2 | |
with: | |
body_path: tmp.md | |
generate_release_notes: true | |
make_latest: "true" | |
draft: false |