Skip to content

Commit

Permalink
tag new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Giona Righini committed Aug 10, 2024
1 parent 46bf204 commit e6f2654
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,34 @@ jobs:

- name: Deploy to Google Cloud Storage
run: gsutil -m rsync -r build gs://${{ vars.BUCKET_NAME }}

tag-new-version:
name: Tag new version
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Read the version from package.json
id: get_version
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const packageJson = fs.readFileSync('./package.json', 'utf8');
const version = JSON.parse(packageJson).version;
core.setOutput('version', version);
- name: Check if tag exists
id: check_tag
uses: mukunku/tag-exists-action@v1.6.0
with:
tag: v${{ steps.get_version.outputs.version }}

- name: Create new tag
if: steps.check_tag.outputs.exists == 'false'
uses: rickstaa/action-create-tag@v1.7
with:
tag: v${{ steps.get_version.outputs.version }}
message: v${{ steps.get_version.outputs.version }}

0 comments on commit e6f2654

Please sign in to comment.