Created
February 24, 2020 08:53
-
-
Save stevenwaterman/3b5cf6bae7521c0fca400c7a3e1ede97 to your computer and use it in GitHub Desktop.
A GitHub Actions worflow for automatic front-end build & deployment with GitHub Pages
This file contains hidden or 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: AutomaticHost | |
on: | |
push: | |
branches: | |
- {BRANCH_NAME} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '10.x' | |
- run: | | |
npm ci | |
{BUILD_COMMAND} | |
- run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git checkout --orphan gh-pages | |
git reset | |
git add {OUT_DIR}/* -f | |
git mv {OUT_DIR}/* ./ -k | |
git commit -m "Update hosted version" | |
- uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
branch: gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment