Repository navigation
76 lines (61 loc) · 3.4 KB
/
Copy pathnode.yml
File metadata and controls
76 lines (61 loc) · 3.4 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
# .github/workflows/update-changelog.yml
name: Run Node.js Scripts and Update Changelog
description: This workflow runs Node.js scripts to convert images, generate thumbnails, update the changelog, and update Supabase when changes are pushed to the main branch.
on:
push:
branches:
- main # Or the branch you want to trigger on
permissions:
contents: write # Grant write permission to the GITHUB_TOKEN
jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Hinzugefügt: Wichtig, um alle Commits für die GitHub API abrufen zu können.
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Use a suitable Node.js version
- name: Install general dependencies
run: npm install # Install project dependencies, including 'sharp'
working-directory: ./assets/ # Run npm install in the ./assets directory
- name: Install ws
run: npm install ws
- name: Install Supabase client library
run: npm install @supabase/supabase-js # Nur Supabase Client Bibliothek, da fetch nativ ist
# Da `update-supabase-changelog.js` im Root-Verzeichnis ausgeführt wird,
# sollten diese Abhängigkeiten im Root installiert werden, falls sie nicht schon global sind.
# Wenn deine `package.json` im Root ist, kannst du `working-directory` hier weglassen oder auf '.' setzen.
- name: Run WebP Converter script
run: node ./assets/media/webp-converter.js # Ensure this path is correct relative to the repo root
working-directory: . # Run script from repository root
- name: Run Thumbnail Generator script
run: node ./assets/media/generate-thumb.js # Ensure this path is correct relative to the repo root
working-directory: . # Run script from repository root
- name: Run Assets JSON Generator script
run: node ./assets/generate-assets-json.js # Ensure this path is correct relative to the repo root
working-directory: . # Run script from repository root
# - name: Run changelog generator script
# run: node ./changelog-gen.js # Ensure this path is correct relative to the repo root
# working-directory: . # Run script from repository root
# env:
# TOKEN: ${{ secrets.TOKEN }} # Set the TOKEN environment variable from GitHub secrets
# Hinzugefügt: Schritt zum Aktualisieren der Supabase Changelog-Tabelle
- name: Run Supabase Changelog Update script
run: node ./update-supabase-changelog.js # Stelle sicher, dass dieser Pfad korrekt ist
working-directory: . # Führe das Skript vom Repository-Root aus
env:
TOKEN: ${{ secrets.TOKEN }} # Dein GitHub PAT für Supabase-Zugriff
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} # Dein Supabase Service Role Key!
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
- name: Commit and push changes
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add ./changelog.json # Ensure this path is correct relative to the repo root
# Füge auch das Supabase-Skript selbst zu `git add` hinzu, falls es sich geändert hat und gepusht werden soll.
git commit -m "Update changelog.json [ci skip]" || echo "No changes to commit"
git push