GitHub Page Deploy #2955
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: GitHub Page Deploy | |
on: | |
schedule: | |
- cron: '0 9,15,18,22 * * *' | |
push: | |
branches: | |
- main | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.20.x | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v3 | |
with: | |
hugo-version: '0.110.0' | |
extended: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('tools/**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Fetch organization | |
working-directory: tools/organization | |
run: go run github.com/echocat/echocat.org/tools/organization --output=../../site/data/organization.json --assets=../../site/assets/images/d "--githubAccessToken=${{ secrets.GITHUB_TOKEN }}" "--gitlabAccessToken=${{ secrets.GITLAB_TOKEN }}" | |
- name: Build page | |
working-directory: site | |
run: hugo --minify | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site/public | |
keep_files: false | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |