Scheduled jobs: Update Hugo modules #32174
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: "Scheduled jobs: Update Hugo modules" | |
on: | |
schedule: | |
- cron: '*/15 * * * *' | |
workflow_dispatch: | |
jobs: | |
merge: | |
name: Update Hugo theme | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.20.x | |
- name: Install Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Install Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.111.0' | |
extended: true | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.PULUMI_BOT_TOKEN }} | |
- name: Configure Git | |
run: | | |
git config --global url."https://${{ secrets.PULUMI_BOT_TOKEN }}:[email protected]/pulumi/pulumi-hugo-internal".insteadOf "https://github.com/pulumi/pulumi-hugo-internal" | |
- name: Update Hugo modules | |
run: | | |
hugo mod get github.com/pulumi/pulumi-hugo/themes/default | |
- name: Identify relevant commits | |
run: | | |
make ensure | |
echo 'NEW_COMMITS<<EOF' >> $GITHUB_ENV | |
node scripts/get-module-diff-details.js >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create a pull request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: pulumi-hugo/refresh | |
author: Pulumi Bot <[email protected]> | |
committer: Pulumi Bot <[email protected]> | |
title: Update Hugo modules | |
labels: "automation/tfgen-provider-docs,automation/merge" | |
commit-message: Update Hugo module references | |
token: ${{ secrets.PULUMI_BOT_TOKEN }} | |
body: | | |
Brings in the latest content from Hugo module repos, including: | |
${{ env.NEW_COMMITS }} | |
notify: | |
if: failure() | |
name: Send slack notification | |
runs-on: ubuntu-latest | |
needs: [merge] | |
steps: | |
- name: Slack Notification | |
uses: docker://sholung/action-slack-notify:v2.3.0 | |
env: | |
SLACK_CHANNEL: docs-ops | |
SLACK_COLOR: "#F54242" | |
SLACK_MESSAGE: "update hugo modules failure in pulumi/docs repo :meow_sad:" | |
SLACK_USERNAME: docsbot | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_ICON: https://www.pulumi.com/logos/brand/avatar-on-white.png |