Skip to content

Commit

Permalink
create git tag in gha
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Dec 3, 2024
1 parent a579e8b commit 49a91e0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# Checkout code
- name: Checkout code
uses: actions/checkout@v4

# Run integration tests
- name: Run Integration Tests
run: |
Expand All @@ -32,7 +32,7 @@ jobs:
release:
name: Release and Publish Docker Image
needs: test # Ensure the test job runs successfully first
needs: test
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -71,6 +71,21 @@ jobs:
echo "New version: $NEW_VERSION"
echo "::set-output name=version::$NEW_VERSION"
# Create a new Git tag
- name: Create and push Git tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NEW_VERSION=${{ steps.determine_version.outputs.version }}
# Configure git user
git config user.name "github-actions"
git config user.email "[email protected]"
# Create and push the tag
git tag -a "$NEW_VERSION" -m "Release $NEW_VERSION"
git push origin "$NEW_VERSION"
# Create a GitHub release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down

0 comments on commit 49a91e0

Please sign in to comment.