deploy site #1686
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: 'deploy site' | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: 15 4 * * * | |
| jobs: | |
| build: | |
| name: build and deploy site | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout... | |
| uses: actions/checkout@v4 | |
| 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 21... | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Set up NodeJS 12... | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '12' | |
| - name: Retrieve mvn repo cache... | |
| uses: actions/cache@v4 | |
| 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@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |