Skip to content

GHA: port Saltbox status script #879

GHA: port Saltbox status script

GHA: port Saltbox status script #879

Workflow file for this run

name: Build & Deploy
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
add-contributors:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: BobAnkh/add-contributors@master
with:
REPO_NAME: 'saltyorg/docs'
CONTRIBUTOR: '### Contributors'
COLUMN_PER_ROW: '6'
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMG_WIDTH: '100'
FONT_SIZE: '14'
PATH: '/README.md'
COMMIT_MESSAGE: 'docs(README): update contributors'
AVATAR_SHAPE: 'square'
build:
runs-on: ubuntu-22.04
if: github.event.repository.fork == false && github.event_name != 'pull_request'
outputs:
url: ${{ steps.cloudflare.outputs.url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Cache ID
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Setup Cache
uses: actions/cache@v4
with:
key: docs-${{ env.cache_id }}
path: .cache
restore-keys: |
docs-
- name: Setup Python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install wheel
run: pip install wheel
- name: Install mkdocs material insiders
run: pip install git+https://${{ secrets.GH_TOKEN }}@github.com/chazlarson/automaticSpoon.git
- name: Install requirements.txt
run: pip install -r requirements.txt
- name: Build mkdocs
run: mkdocs build
- name: Publish to Cloudflare Pages
if: github.event.repository.fork == false
id: cloudflare
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: 86b9f680e99b6d172395cc7309a9d8a8
projectName: docs
directory: site
gitHubToken: ${{ secrets.GH_TOKEN }}
webhook:
name: 'webhook'
runs-on: self-hosted
needs: build
if: always() && github.event_name != 'pull_request' && github.event.repository.fork == false
steps:
- uses: actions/checkout@v4
- name: Determine Workflow Conclusion
run: ./scripts/workflow-status.sh ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.run_id }}
- uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ env.WORKFLOW_CONCLUSION }}