Skip to content

Commit 39633e2

Browse files
committed
Automated releases
1 parent 70e5d89 commit 39633e2

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
name: Deploy
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
tag_name:
7+
description: 'Tag name for the release'
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
tag_name:
13+
description: 'Tag name for the release'
14+
required: true
15+
type: string
616

717
jobs:
818
deploy:
@@ -12,6 +22,7 @@ jobs:
1222
- name: Checkout
1323
uses: actions/checkout@v4
1424
with:
25+
ref: ${{ inputs.tag_name }}
1526
fetch-depth: 1
1627

1728
- name: Install Node.js

.github/workflows/release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,20 @@ jobs:
1919
uses: justincy/github-action-npm-release@2.0.1
2020
id: release
2121
with:
22-
token: ${{ secrets.GITHUB_TOKEN }}
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Trigger Deploy Workflow
25+
if: steps.release.outputs.released == 'true'
26+
uses: actions/github-script@v7
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
script: |
30+
await github.rest.actions.createWorkflowDispatch({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
workflow_id: 'deploy.yml',
34+
ref: 'main',
35+
inputs: {
36+
tag_name: '${{ steps.release.outputs.tag }}'
37+
}
38+
})

0 commit comments

Comments
 (0)