Skip to content

ci(deps): bump the all group across 1 directory with 5 updates #1818

ci(deps): bump the all group across 1 directory with 5 updates

ci(deps): bump the all group across 1 directory with 5 updates #1818

Workflow file for this run

# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: Deploy Blog Website
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
schedule:
- cron: 0 16 * * *
permissions: {}
concurrency:
group: blog-swa-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
TARGET_OWNER: azure-octo
TARGET_REPO: radius-publisher
TARGET_WORKFLOW_FILE: swa.yml
MAX_WAIT_SECONDS: "600"
POLL_INTERVAL_SECONDS: "15"
SWA_CLI_APP_NAME: radius-blog
PREVIEW_COMMENT_HEADER: swa-preview
BUILD_OUTPUT_DIR: radblog/public
BUILD_ARTIFACT_NAME: radblog-public
jobs:
approval:
name: Approval
runs-on: ubuntu-24.04
timeout-minutes: 5
environment: ${{ github.event_name != 'merge_group' && github.event.pull_request.user.login != 'dependabot[bot]' && 'pr' || '' }} # this is used to enforce approval requirements in the GitHub UI
steps:
- name: 👍 Approve
run: echo "PR Workflow Approved"
build:
name: Build
if: >-
!(github.event_name == 'pull_request'
&& github.event.action == 'closed')
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
persist-credentials: false
- name: Setup Go
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: radblog/go.mod
- name: Restore Go Modules Cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
if: steps.setup-go.outputs.cache-hit != 'true'
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('radblog/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: radblog/.node-version
cache: npm
cache-dependency-path: radblog/package-lock.json
- name: Install root dependencies
working-directory: radblog
run: npm ci --ignore-scripts
- name: Install Docsy dependencies
working-directory: radblog/themes/docsy
run: npm install --no-fund --no-audit
- name: Build site
working-directory: radblog
run: |
if [ "${EVENT_NAME}" = 'pull_request' ]; then
npm run build:preview
else
npm run build
fi
env:
HUGO_ENV: production
EVENT_NAME: ${{ github.event_name }}
- name: Upload build artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ env.BUILD_ARTIFACT_NAME }}
path: ${{ env.BUILD_OUTPUT_DIR }}
if-no-files-found: error
retention-days: 1
dispatch-production:
name: Dispatch Production Deploy
if: >-
(github.event_name == 'push' && github.ref == 'refs/heads/main')
|| github.event_name == 'schedule'
needs:
- build
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
.github/scripts/monitor-remote-workflow.mjs
- name: Get App Token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
id: github-app-token
with:
app-id: ${{ secrets.RADIUS_PUBLISHER_BOT_APP_ID }}
private-key: ${{ secrets.RADIUS_PUBLISHER_BOT_PRIVATE_KEY }}
permission-metadata: read
permission-actions: read
permission-contents: write
owner: ${{ env.TARGET_OWNER }}
repositories: |
${{ env.TARGET_REPO }}
- name: Capture dispatch start time
id: dispatch-start
run: |
echo "started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "${GITHUB_OUTPUT}"
- name: Dispatch production deploy
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ steps.github-app-token.outputs.token }}
repository: ${{ env.TARGET_OWNER }}/${{ env.TARGET_REPO }}
event-type: swa
client-payload: |-
{
"action": "deploy",
"environment": "production",
"source_repository": "${{ github.repository }}",
"source_run_id": "${{ github.run_id }}",
"artifact_name": "${{ env.BUILD_ARTIFACT_NAME }}",
"swa_cli_app_name": "${{ env.SWA_CLI_APP_NAME }}"
}
- name: Monitor remote workflow
id: monitor
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{ steps.github-app-token.outputs.token }}
script: |
const { default: script } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/monitor-remote-workflow.mjs`)
await script({github, core})
env:
INPUT_OWNER: ${{ env.TARGET_OWNER }}
INPUT_REPO: ${{ env.TARGET_REPO }}
INPUT_WORKFLOW_FILE: ${{ env.TARGET_WORKFLOW_FILE }}
INPUT_DISPATCH_STARTED_AT: ${{ steps.dispatch-start.outputs.started_at }}
INPUT_MAX_WAIT_SECONDS: ${{ env.MAX_WAIT_SECONDS }}
INPUT_POLL_INTERVAL_SECONDS: ${{ env.POLL_INTERVAL_SECONDS }}
- name: Show failed logs
if: failure()
run: |
gh run view "${RUN_ID}" --repo "${TARGET_OWNER}/${TARGET_REPO}" --log-failed || true
env:
GH_TOKEN: ${{ steps.github-app-token.outputs.token }}
RUN_ID: ${{ steps.monitor.outputs.run_id }}
dispatch-preview:
name: Dispatch Preview Deploy
if: >-
github.event_name == 'pull_request'
&& github.event.action != 'closed'
&& github.event.pull_request.head.repo.full_name == github.repository
needs:
- approval
- build
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
.github/scripts/monitor-remote-workflow.mjs
- name: Get App Token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
id: github-app-token
with:
app-id: ${{ secrets.RADIUS_PUBLISHER_BOT_APP_ID }}
private-key: ${{ secrets.RADIUS_PUBLISHER_BOT_PRIVATE_KEY }}
permission-metadata: read
permission-actions: read
permission-contents: write
owner: ${{ env.TARGET_OWNER }}
repositories: |
${{ env.TARGET_REPO }}
- name: Capture dispatch start time
id: dispatch-start
run: |
echo "started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "${GITHUB_OUTPUT}"
- name: Dispatch preview deploy
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ steps.github-app-token.outputs.token }}
repository: ${{ env.TARGET_OWNER }}/${{ env.TARGET_REPO }}
event-type: swa
client-payload: |-
{
"action": "deploy",
"environment": "preview",
"pr_number": ${{ github.event.pull_request.number }},
"source_repository": "${{ github.repository }}",
"source_run_id": "${{ github.run_id }}",
"artifact_name": "${{ env.BUILD_ARTIFACT_NAME }}",
"swa_cli_app_name": "${{ env.SWA_CLI_APP_NAME }}"
}
- name: Monitor remote workflow
id: monitor
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{ steps.github-app-token.outputs.token }}
script: |
const { default: script } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/monitor-remote-workflow.mjs`)
await script({github, core})
env:
INPUT_OWNER: ${{ env.TARGET_OWNER }}
INPUT_REPO: ${{ env.TARGET_REPO }}
INPUT_WORKFLOW_FILE: ${{ env.TARGET_WORKFLOW_FILE }}
INPUT_DISPATCH_STARTED_AT: ${{ steps.dispatch-start.outputs.started_at }}
INPUT_MAX_WAIT_SECONDS: ${{ env.MAX_WAIT_SECONDS }}
INPUT_POLL_INTERVAL_SECONDS: ${{ env.POLL_INTERVAL_SECONDS }}
- name: Upsert preview PR comment
if: success()
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
with:
header: ${{ env.PREVIEW_COMMENT_HEADER }}
skip_unchanged: true
message: |
### Static Web App Preview
| Environment | Deployment |
|---|---|
| pr${{ github.event.pull_request.number }} | [View workflow run](${{ steps.monitor.outputs.run_url }}) |
_Deployed from commit `${{ github.event.pull_request.head.sha }}` via the publisher workflow._
- name: Show failed logs
if: failure()
run: |
gh run view "${RUN_ID}" --repo "${TARGET_OWNER}/${TARGET_REPO}" --log-failed || true
env:
GH_TOKEN: ${{ steps.github-app-token.outputs.token }}
RUN_ID: ${{ steps.monitor.outputs.run_id }}
dispatch-cleanup:
name: Dispatch Preview Cleanup
if: >-
github.event_name == 'pull_request'
&& github.event.action == 'closed'
&& github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout: |
.github/scripts/monitor-remote-workflow.mjs
- name: Get App Token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
id: github-app-token
with:
app-id: ${{ secrets.RADIUS_PUBLISHER_BOT_APP_ID }}
private-key: ${{ secrets.RADIUS_PUBLISHER_BOT_PRIVATE_KEY }}
permission-metadata: read
permission-actions: read
permission-contents: write
owner: ${{ env.TARGET_OWNER }}
repositories: |
${{ env.TARGET_REPO }}
- name: Delete preview PR comment
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3.0.2
with:
header: ${{ env.PREVIEW_COMMENT_HEADER }}
delete: true
- name: Capture dispatch start time
id: dispatch-start
run: |
echo "started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "${GITHUB_OUTPUT}"
- name: Dispatch preview cleanup
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
token: ${{ steps.github-app-token.outputs.token }}
repository: ${{ env.TARGET_OWNER }}/${{ env.TARGET_REPO }}
event-type: swa
client-payload: |-
{
"action": "close",
"source_repository": "${{ github.repository }}",
"pr_number": ${{ github.event.pull_request.number }},
"swa_cli_app_name": "${{ env.SWA_CLI_APP_NAME }}"
}
- name: Monitor remote workflow
id: monitor
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
github-token: ${{ steps.github-app-token.outputs.token }}
script: |
const { default: script } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/monitor-remote-workflow.mjs`)
await script({github, core})
env:
INPUT_OWNER: ${{ env.TARGET_OWNER }}
INPUT_REPO: ${{ env.TARGET_REPO }}
INPUT_WORKFLOW_FILE: ${{ env.TARGET_WORKFLOW_FILE }}
INPUT_DISPATCH_STARTED_AT: ${{ steps.dispatch-start.outputs.started_at }}
INPUT_MAX_WAIT_SECONDS: ${{ env.MAX_WAIT_SECONDS }}
INPUT_POLL_INTERVAL_SECONDS: ${{ env.POLL_INTERVAL_SECONDS }}
- name: Show failed logs
if: failure()
run: |
gh run view "${RUN_ID}" --repo "${TARGET_OWNER}/${TARGET_REPO}" --log-failed || true
env:
GH_TOKEN: ${{ steps.github-app-token.outputs.token }}
RUN_ID: ${{ steps.monitor.outputs.run_id }}