-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (56 loc) · 2.72 KB
/
jaen-publish.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
# SPDX-FileCopyrightText: Copyright © 2021 snek.at
# SPDX-License-Identifier: EUPL-1.2
#
# Use of this source code is governed by an EUPL-1.2 license that can be found
# in the LICENSE file at https://snek.at/license
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#name
name: Jaen Publish
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#on
on:
repository_dispatch:
types: [update-jaen-data]
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobs
jobs:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_id
jaen-publish:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest
env:
JAEN_PAYLOAD: ${{ toJson(github.event.client_payload) }}
JAEN_PAGES_MIGRATION_URL: ${{github.event.client_payload.jaendata_url}}
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idsteps
steps:
# https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
# https://github.com/actions/checkout
- name: Checkout 🛎️
uses: actions/[email protected]
with:
path: '.'
- uses: actions/setup-node@v2
with:
node-version: '15'
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsid
- name: Configure GitHub authentication 🔧
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: |
# Git: set identity
git config --global user.name "snekmin"
git config --global user.email "[email protected]"
# Git: set remote
# https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation
git remote set-url origin "https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsid
- name:
Deploy jaen-data to Github Pages 🚀
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstepsrun
run: |
# Create gh-pages branch without history
#git checkout --orphan gh-pages
git checkout main
yarn install
npx jaen-pages build
yarn deploy
# Git: add, commit, and push changes
git add .
git commit -m "jaen-publish(jaen-data.json): update jaen-data" || echo "Nothing to commit, working tree clean."
GIT_TRACE=1 git push -f --verbose origin main