Skip to content

Commit 54dd271

Browse files
committed
Variable repo name in CI
1 parent 1fc8be9 commit 54dd271

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
- name: Tag commit
3131
id: tag
3232
run: |
33-
LAST_TAG=$(git describe --abbrev=0)
34-
VERSION=$(git diff "$LAST_TAG" HEAD "$VERSION_PATH" | sed -nr "s/$VERSION_REGEX/\1/p")
33+
VERSION=$(git diff ${{ github.event.before }} HEAD "$VERSION_PATH" | sed -nr "s/$VERSION_REGEX/\1/p")
3534
[ "$VERSION" ] && git tag -m "v$VERSION" "$VERSION"
3635
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3736
@@ -65,16 +64,24 @@ jobs:
6564
uses: docker/build-push-action@v6
6665
env:
6766
DATABASE_URL: ${{ secrets.DATABASE_URL }}
67+
dockerhub_repository: ${{ vars.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
68+
version: ${{ needs.tag-commit.outputs.version }}
6869
with:
6970
secret-envs: database-url=DATABASE_URL
7071
push: true
7172
provenance: mode=max
7273
sbom: true
7374
tags: |
74-
${{ vars.DOCKERHUB_USERNAME }}/arabot:latest
75-
${{ vars.DOCKERHUB_USERNAME }}/arabot:${{ needs.tag-commit.outputs.version }}
75+
${{ env.dockerhub_repository }}:latest
76+
${{ env.dockerhub_repository }}:${{ env.version }}
7677
ghcr.io/${{ github.repository }}:latest
77-
ghcr.io/${{ github.repository }}:${{ needs.tag-commit.outputs.version }}
78+
ghcr.io/${{ github.repository }}:${{ env.version }}
79+
annotations: |
80+
org.opencontainers.image.title=AraBot
81+
org.opencontainers.image.authors="${{ github.event.repository.owner.url }}"
82+
org.opencontainers.image.version="${{ env.version }}"
83+
org.opencontainers.image.source="${{ github.repositoryUrl }}"
84+
org.opencontainers.image.url="https://hub.docker.com/repository/docker/${{ env.dockerhub_repository }}/tags/${{ env.version }}"
7885
cache-from: type=gha
7986
cache-to: type=gha,mode=max
8087

arabot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from dotenv import load_dotenv
44

5-
__version__ = "8.23.4"
5+
__version__ = "8.23.5"
66

77
load_dotenv()
88
TESTING = bool(getenv("TESTING"))

0 commit comments

Comments
 (0)