generated from levibostian/action-node-blanky
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.51 KB
/
deploy-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Deploy action
on:
push:
branches: [main, beta, alpha]
workflow_dispatch: # allow manually deploying from Actions tab
jobs:
deploy-git-tag-and-release:
name: Deploy git tags
runs-on: ubuntu-latest
permissions:
contents: write # push git commits/releases
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run compile
- name: Deploy via semantic release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: latest
extra_plugins: |
conventional-changelog-conventionalcommits
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
major-version-bump: # update major version tags (ex: v1, v2, v3, etc.)
runs-on: ubuntu-latest
needs: deploy-git-tag-and-release # to wait for new git tag to be made.
steps:
# create a github token with permissions to create tags *and* permissions to update workflows.
# This method is an alternative to using personal access tokens.
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.GENERATE_TOKEN_APP_ID }}
private_key: ${{ secrets.GENERATE_TOKEN_PRIVATE_KEY_B64 }}
# bump major version tag
- uses: levibostian/action-bump-major-tag@v1
with:
tag-prefix: "v"
token: ${{ steps.generate-token.outputs.token }}