Skip to content

update-activity-content #694

update-activity-content

update-activity-content #694

Workflow file for this run

name: update-activity-content
on:
push:
branches:
- 'main'
paths:
- '.github/*.ts'
- '.github/graphql/**'
- '_config.ts'
- 'deno.json'
- 'member/**'
- 'site/**'
repository_dispatch:
workflow_dispatch:
permissions:
contents: read
env:
GH_BOT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GH_BOT_NAME: "GitHub Action"
DENO_DIR: .deno-cache
REPO: commonhaus/commonhaus.github.io
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
concurrency:
group: "push-content"
steps:
- name: Setup Deno environment
uses: denoland/setup-deno@v2
with:
deno-version: v1.x
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Deno dependencies
uses: actions/cache@v4
with:
path: ${{ env.DENO_DIR }}
key: ${{ hashFiles('deno.lock') }}
- name: Git Config
run: |
git config user.name ${{ env.GH_BOT_NAME }}
git config user.email ${{ env.GH_BOT_EMAIL }}
- id: git-push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
echo "updated=true" >> $GITHUB_OUTPUT
- name: Git Submodule Update
id: submodule
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git pull --recurse-submodules
git submodule update --init --remote --recursive
deno task lastmod
if git diff --quiet; then
echo "-- No changes -- "
else
git commit -am "🆙 Auto-update submodule references"
git pull --rebase
git push
echo "updated=true" >> $GITHUB_OUTPUT
fi
- name: Foundation Metadata Update
id: about
env:
GH_TOKEN: ${{ secrets.WEB_REPO_READ }}
run: |
deno task about
git add -A -- ./site/_generated/about.yml
if git diff --quiet HEAD; then
echo "-- No changes -- "
else
git commit -am "👥 Auto-update foundation metadata"
git pull --rebase
git push
echo "updated=true" >> $GITHUB_OUTPUT
fi
- name: Git Discussion Update
id: discussion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
deno task activity
git add -A -- ./site/_generated/activity ./site/_generated/authors.yml
if git diff --quiet HEAD; then
echo "-- No changes -- "
else
git commit -am "💬 Auto-update GH Activity"
git pull --rebase
git push
echo "updated=true" >> $GITHUB_OUTPUT
fi
- name: Push GH Pages
if: ${{ steps.git-push.outputs.updated == 'true' || steps.submodule.outputs.updated == 'true' || steps.about.outputs.updated == 'true' || steps.discussion.outputs.updated == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run -R commonhaus/commonhaus.github.io gh-pages.yml