Build Site #2792
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: Build Site | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "30 9 * * *" | |
- cron: "5 16 * * 3,4" | |
jobs: | |
build_deploy: | |
if: ${{ github.repository == 'FlowFuse/website' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out website repository | |
uses: actions/checkout@v4 | |
with: | |
path: 'website' | |
- name: Check out FlowFuse/flowfuse repository (to access the docs) | |
uses: actions/checkout@v4 | |
with: | |
repository: 'FlowFuse/flowfuse' | |
ref: main | |
path: 'flowfuse' | |
- name: Generate a token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.GH_BOT_APP_ID }} | |
private_key: ${{ secrets.GH_BOT_APP_KEY }} | |
- name: Check out FlowFuse/blueprint-library repository (to access the blueprints) | |
uses: actions/checkout@v4 | |
with: | |
repository: 'FlowFuse/blueprint-library' | |
ref: main | |
path: 'blueprint-library' | |
token: ${{ steps.generate_token.outputs.token }} | |
- name: Install jq | |
run: sudo apt-get -qy install jq | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
cache-dependency-path: './website/package-lock.json' | |
- run: npm run docs | |
working-directory: 'website' | |
- run: npm run blueprints | |
working-directory: 'website' | |
- name: Commit Latest Docs | |
run: | | |
cd ./website | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add src/docs/* -A -f | |
git commit -a -m "Bot: update docs" | |
- name: Commit Latest Blueprints | |
run: | | |
cd ./website | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add src/blueprints/* -A -f | |
git commit -a -m "Bot: update blueprints" | |
- name: Push to 'live' branch | |
uses: ad-m/github-push-action@master | |
with: | |
directory: './website' | |
branch: live | |
force: true |