Add workflow dispatch #97
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
name: Deploy to GH Pages | |
on: | |
push: | |
branches: | |
- master | |
repository_dispatch: | |
types: [wordpress] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
# do not persist-credentials to allow git push to another repo | |
persist-credentials: 'false' | |
- name: Install deps | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Deploy | |
# subtree instructions from https://gist.github.com/tduarte/eac064b4778711b116bb827f8c9bef7b | |
run: | | |
git config --global user.name $GITHUB_ACTOR | |
git config --global user.email "[email protected]" | |
git add -f dist | |
git commit --no-verify -m "Update from commit tnguyen14/tridnguyen.com@$GITHUB_SHA" | |
git subtree split --prefix dist -b gh-pages | |
git remote add gh-pages https://x-access-token:${{ secrets.GH_PAGES_TOKEN }}@github.com/tnguyen14/tnguyen14.github.io.git | |
git push -f gh-pages gh-pages:master |