Skip to content

Commit

Permalink
ci: Trigger preview build from release event (#1319)
Browse files Browse the repository at this point in the history
Cloase #1242 

### Description of Changes
This PR builds up on the current release action - to trigger instance
side of build after release. This PR:
NASA-IMPACT/veda-config#502 needs to be merged
before.
  • Loading branch information
hanbyul-here authored Dec 16, 2024
1 parent 2ec1144 commit 22e3772
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PEM }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}
token: ${{ steps.generate-token.outputs.token }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
Expand All @@ -29,4 +36,15 @@ jobs:
- run: yarn
- run: yarn release --ci --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
preview-build:
runs-on: ubuntu-latest
needs: "release"
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate-token.outputs.token }}
repository: nasa-impact/veda-config
event-type: update-version
client-payload: '{"ref": "${{ github.ref }}", "VERSION_NUMBER": "${{ env.VERSION_NUMBER }}"}'
4 changes: 3 additions & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"hooks": {},
"hooks": {
"after:release": "echo \"VERSION_NUMBER=v${version}\" >> \"$GITHUB_ENV\" "
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
Expand Down

0 comments on commit 22e3772

Please sign in to comment.