-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
65 lines (64 loc) · 2.12 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: "Generate Chain Status Webapp"
description: "Executes chain-status webapp generation"
inputs:
github-token:
description: "the github token"
required: true
info-md-url:
description: "the markdown info file url for the info section"
required: true
gh-pages-branch:
description: "the gh-pages branch"
default: "gh-pages"
required: false
runs:
using: "composite"
steps:
- name: set PUBLIC_URL
shell: bash
run: |
PUBLIC_URL="https://${GITHUB_REPOSITORY_OWNER}.github.io/${GITHUB_REPOSITORY#*/}"
echo "PUBLIC_URL=${PUBLIC_URL}" >> $GITHUB_ENV
- name: print PUBLIC_URL
shell: bash
run: echo $PUBLIC_URL
- name: Checkout chain-status repo
uses: actions/checkout@v2
with:
path: ./current-project
ref: ${{ inputs.gh-pages-branch }}
- name: Checkout chain-status repo
uses: actions/checkout@v2
with:
repository: kiegroup/chain-status
path: ./chain-status
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: yarn
shell: bash
working-directory: ./chain-status
- name: Check old data existence
id: check_old_data
uses: andstor/file-existence-action@v1
with:
files: "./current-project/data"
- name: Copy old data
if: steps.check_old_data.outputs.files_exists == 'true'
shell: bash
run: "cp ./current-project/data ./chain-status/packages/webpage/public/ -r"
- name: Download info file
shell: bash
run: wget ${{ inputs.info-md-url }} -O ./chain-status/packages/webpage/public/data/info.md
- run: yarn predeploy
shell: bash
working-directory: ./chain-status
- name: Deploy with gh-pages
shell: bash
working-directory: ./chain-status
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages -d packages/webpage/build -u "github-actions-bot <[email protected]>" b ${{ inputs.gh-pages-branch }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}