Skip to content

Commit

Permalink
ci: add dispatch-nightly-build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
niklr committed May 10, 2022
1 parent f3cf3da commit 04984a5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Workflows

## Create Personal Access Token (PAT):

- Login on GitHub as vitelabs-bot
- Go to https://github.com/settings/tokens
- Generate new token
- Note: WORKFLOW_PUBLIC_REPO
- Expiration: No expiration
- Select scopes: repo -> public_repo

## Add repo secret

- Go to Settings -> Secrects -> Actions
- New repository secret
- Name: WORKFLOW_PUBLIC_REPO_PAT
- Value: ghp_...
30 changes: 30 additions & 0 deletions .github/workflows/dispatch-nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: dispatch-nightly-build

on:
push:
branches:
- master
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Read buildversion
id: buildversion
uses: juliangruber/read-file-action@v1
with:
path: ./version/buildversion

- name: Echo buildversion
# trim buildversion and set environment variable
run: echo "${{ steps.buildversion.outputs.content }}" | xargs | echo "buildversion=$(</dev/stdin)" >> $GITHUB_ENV

- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.WORKFLOW_PUBLIC_REPO_PAT }}
repository: vitelabs/go-vite-nightly
event-type: nightly-build-event
client-payload: '{"branch": "master", "tag": "${{ env.buildversion }}"}'

0 comments on commit 04984a5

Please sign in to comment.