generated from trustoverip/terms-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dhh1128 <[email protected]>
- Loading branch information
dhh1128
committed
Nov 8, 2021
1 parent
6f9cef2
commit 1b82602
Showing
1 changed file
with
18 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: tt Run and Publish | ||
name: Update glossary | ||
|
||
# Controls when the workflow will run | ||
on: | ||
gollum: | ||
branches: [main] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
workflow_dispatch: | ||
inputs: | ||
glossaryDefFile: | ||
required: true | ||
|
@@ -16,20 +16,19 @@ on: | |
default: gh_pages | ||
description: This is where the output of script will be pushed to. | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
|
||
- name: Install deps | ||
run: | | ||
git clone https://github.com/trustoverip/tt.git | ||
python -m pip install marko | ||
- name: Set variables | ||
env: | ||
DEFAULT_GLOSSARY_DEF_FILE: glossary.json | ||
|
@@ -39,19 +38,19 @@ jobs: | |
echo "DEPLOY_BRANCH=${{ github.event.inputs.deployBranch || env.DEFAULT_DEPLOY_BRANCH }}" >> $GITHUB_ENV | ||
- name: Run script | ||
run: ./tt/bin/tt glossary ${{ env.GLOSSARY_DEF_FILE }} >glossary.html | ||
- name: Publishing | ||
run: ./tt/bin/tt glossary ${{ env.GLOSSARY_DEF_FILE }} >glossary.html.new | ||
|
||
- name: Setup git config | ||
run: | | ||
mkdir public | ||
cp glossary.html public | ||
cd public | ||
git config --global init.defaultBranch main | ||
git init | ||
git config --local user.email "${{ github.actor }}@users.noreply.github.com" | ||
git config --local user.name "${{ github.actor }}" | ||
git add . | ||
git commit -m "Add changes" -a | ||
git push -f https://${{ secrets.ACCESS_TOKEN }}@github.com/${{ github.repository}}.git main:${{ env.DEPLOY_BRANCH }} | ||
echo DONE | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
- name: Publishing | ||
run: | | ||
git fetch origin | ||
git checkout ${{ env.DEPLOY_BRANCH }} | ||
mv glossary.html.new glossary.html | ||
git add glossary.html | ||
git commit -m "auto-update glossary" | ||
git push | ||
echo DONE |