Build Eleventy #18661
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 Eleventy | |
on: | |
schedule: | |
- cron: "0 * * * *" | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "META.d/**" | |
- "**/*.md" | |
pull_request_target: | |
types: | |
- opened | |
- reopened | |
- ready_for_review | |
- synchronize | |
paths-ignore: | |
- "META.d/**" | |
- "**/*.md" | |
workflow_dispatch: {} # allow manual triggering just in case | |
concurrency: ${{ github.workflow }}-${{ github.head_ref }} | |
env: | |
GIT_REF: ${{ github.head_ref || github.ref }} | |
GIT_REPO: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
issues: read | |
pull-requests: read | |
actions: read | |
checks: read | |
statuses: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ env.GIT_REF }} | |
repository: ${{ env.GIT_REPO }} | |
- name: Setup Node.js | |
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: | | |
yarn install --frozen-lockfile | |
- name: Grab data updates | |
run: node ./scripts/collect-status.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Site | |
run: yarn build | |
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | |
id: artifact-upload-step | |
with: | |
name: build-artifact | |
path: _site | |
retention-days: 14 | |
publish: | |
name: Publish to GH Pages | |
runs-on: ubuntu-latest | |
if: ${{ !github.event.pull_request && github.ref == 'refs/heads/main' }} | |
needs: | |
- build | |
permissions: | |
contents: write | |
pages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: build-artifact | |
path: _site | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 # TSCCR: could not find entry for peaceiris/actions-gh-pages | |
with: | |
publish_dir: ./_site | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
report: | |
name: Report status | |
runs-on: ubuntu-latest | |
if: ${{ !github.event.pull_request && failure() }} | |
needs: | |
- build | |
permissions: | |
contents: read | |
steps: | |
- name: Send failures to Slack | |
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 | |
with: | |
payload: | | |
{ | |
"name": "cdktf-provider-dashboard", | |
"run_url": "https://github.com/cdktf/cdktf-provider-dashboard/actions/runs/${{ github.run_id }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.FAILURE_SLACK_WEBHOOK_URL }} |