-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (66 loc) · 2.19 KB
/
Copy pathog.yml
File metadata and controls
79 lines (66 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: og cards
# Manual only, and deliberately so.
#
# Regenerating cards writes to public/og, which is tracked, so this job needs
# write access. A workflow with write access must never run against code from a
# fork, which rules out `pull_request`. A maintainer runs this after merging a
# content change instead.
on:
workflow_dispatch:
inputs:
type:
description: "Which set to regenerate"
required: true
default: "all"
type: choice
options: [all, blog, compare, database]
slug:
description: "Single slug (optional)"
required: false
type: string
permissions:
contents: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
tools: composer:v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Resolve the Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache Composer downloads
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ hashFiles('composer.lock') }}
restore-keys: composer-${{ runner.os }}-
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Install Chromium
run: |
npm install -g puppeteer
npx puppeteer browsers install chrome
- name: Prepare environment
run: |
cp .env.example .env
php artisan key:generate
- name: Generate cards
run: |
ARGS=""
if [ "${{ inputs.type }}" != "all" ]; then ARGS="$ARGS --type=${{ inputs.type }}"; fi
if [ -n "${{ inputs.slug }}" ]; then ARGS="$ARGS --slug=${{ inputs.slug }}"; fi
php artisan og:generate $ARGS
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "chore(og): regenerate social cards"
file_pattern: public/og/**