Skip to content

Commit

Permalink
1473: Create a git tag after deploying (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdooner authored Oct 15, 2024
1 parent 0dc481c commit b6f2155
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
needs: [database-migrations]
permissions:
contents: read
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
Expand All @@ -48,3 +48,19 @@ jobs:
- name: Deploy release
working-directory: .
run: make release-deploy APP_NAME=${{ inputs.app_name }} ENVIRONMENT=${{ inputs.environment }}

- name: Push git tag with timestamp
if: success()
run: |
# Create a tag like "deploy/prod/2024-10-09-11:00:00".
#
# Skip tagging in "dev" environment (our demo site) since we deploy
# on every commit.
if [ "${{ inputs.environment }}" != "dev" ]; then
export TZ="America/New_York"
TAG_NAME="deploy/${{ inputs.environment }}/$(date +'%Y-%m-%d-%H:%M:%S')"
git config --local user.name "github-actions"
git config --local user.email "[email protected]"
git tag "$TAG_NAME"
git push origin "$TAG_NAME"
fi

0 comments on commit b6f2155

Please sign in to comment.