-
Notifications
You must be signed in to change notification settings - Fork 60
38 lines (33 loc) · 1.05 KB
/
build-release.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
name: Workflow for Latest Release
on:
release:
types: [created]
jobs:
get-latest-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest release tag
id: latest-release
uses: actions/github-script@v7
with:
script: |
const response = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
return response.data.tag_name;
- name: Use latest release tag
run: |
echo "The latest release tag is ${{ steps.latest-release.outputs.result }}"
- name: Trigger Docker build workflow
uses: actions/github-script@v7
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'docker-image.yml',
ref: ${{ steps.latest-release.outputs.result }}
})