chore: update gh actions to bind main branch #7
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
# This is a workflow to build and deploy the unravel project to Github Pages | |
name: Deploy to GitHub Pages | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: jorelali/setup-elm@v3 | |
with: | |
elm-version: 0.19.1 | |
- uses: actions/checkout@v2 | |
- run: mkdir -p build | |
- run: cp public/index.html build | |
- run: cp -rf assets build | |
- run: elm make src/Main.elm --output build/elm.js | |
- name: Deploy to GitHub Pages | |
if: success() | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
target_branch: gh-pages | |
build_dir: build | |
keep_history: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |