Skip to content

Commit

Permalink
Tweak glossary update action
Browse files Browse the repository at this point in the history
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.
37 changes: 18 additions & 19 deletions .github/workflows/glossary.yml
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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 1b82602

Please sign in to comment.