chore(ci): tag deployment versions
This commit is contained in:
parent
6fdf7f0b9a
commit
733c1e044b
14
.github/workflows/sync-to-production.yaml
vendored
14
.github/workflows/sync-to-production.yaml
vendored
@ -1,9 +1,7 @@
|
||||
name: Sync main to sandbox-production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@ -31,3 +29,13 @@ jobs:
|
||||
git checkout sandbox-production || git checkout -b sandbox-production
|
||||
git merge --strategy-option theirs main
|
||||
git push origin sandbox-production
|
||||
|
||||
- name: Tag the deployment
|
||||
if: github.ref == 'refs/heads/main'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Increment version from previous tag of format vX
|
||||
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//' | awk -F. -v OFS=. '{$NF++;print}')
|
||||
git tag -a "v$VERSION" -m "Deploy v$VERSION to production"
|
||||
git push origin "v$VERSION"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user