Skip to content

Commit

Permalink
Merge pull request #9 from godatadriven/release-tag-commits
Browse files Browse the repository at this point in the history
Tag commits during release
  • Loading branch information
pgoslatara authored Jun 30, 2024
2 parents 989077f + d39a3ad commit 1035fd7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/release_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
packages: write
steps:
Expand All @@ -33,6 +33,9 @@

- uses: actions/checkout@v4

- name: Fetch tags
run: git fetch --prune --unshallow --tags

- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
Expand All @@ -57,20 +60,29 @@
run: poetry self add poetry-bumpversion

- name: Bump version
run: poetry version ${{ inputs.version_bump_type }}
run: |
poetry version $(git tag --sort version:refname | tail -n 1)
poetry version ${{ inputs.version_bump_type }}
- name: Save version to env var
id: version
run: echo "version=$(poetry version --short)" >> $GITHUB_OUTPUT

- name: Tag commit and push
run: |
git config --globa user.email "[email protected]"
git config --global user.name "github-actions[bot]"
git tag -a ${{ steps.version.outputs.version }} -m "${{ steps.version.outputs.version }}"
git push origin "${{ steps.version.outputs.version }}"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.sha }}
type=raw,value=${{ steps.version.outputs.version }}
type=raw,value=${{ github.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down

0 comments on commit 1035fd7

Please sign in to comment.