deploy site #1198
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 site' | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: 15 4 * * * | |
jobs: | |
build: | |
name: build and deploy site | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout... | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# setup environment: Hugo, JDK and Node | |
- name: Setup Hugo... | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.67.1' | |
- name: Set up JDK 11... | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Set up NodeJS 12... | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '12' | |
- name: Retrieve mvn repo cache... | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-build-v1 | |
restore-keys: ${{ runner.os }}-maven | |
# Build site | |
- name: Yarn build app... | |
run: cd ./app && yarn run build | |
shell: bash | |
- name: Yarn build scripts... | |
run: cd ./scripts && yarn run build | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.STARS_READ_ACCESS_TOKEN }} | |
- name: Run Hugo... | |
run: hugo | |
# Deploy to the GitHub pages | |
- name: Deploy... | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
publish_branch: gh-pages |