mirror of
https://github.com/Noratrieb/std-internal-docs.git
synced 2026-01-14 17:45:03 +01:00
59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: ["main"]
|
|
schedule:
|
|
- cron: "0 0 * * *" # every day at 00:00 UTC, should be equivalent to the nightly.
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: "Create root directory"
|
|
run: mkdir ./www-root
|
|
- name: Run the build
|
|
run: ./build.sh
|
|
- name: Upload static files as artifact
|
|
id: deployment
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: www-root
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|
|
|
|
keep-alive:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: write
|
|
steps:
|
|
# We don't often commit to this repository, and without any activity GitHub Actions will
|
|
# disable scheduled workflows after 60 days. It turns out that calling the "enable" API even
|
|
# before the workflow is disabled resets the 60 days counter though!
|
|
#
|
|
# Copied from https://github.com/rust-lang/generate-manifest-list/blob/5440ac3d7029fcb961854883c5ac267d50fed15b/.github/workflows/cron.yml
|
|
- name: Call the GitHub API
|
|
run: |
|
|
curl -X PUT "https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/build.yml/enable" -H "Authorization: token ${GITHUB_TOKEN}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|