Source Update #1331
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
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
name: Source Update | |
jobs: | |
update: | |
name: Update | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ScratchAddons/website-i18n | |
uses: actions/checkout@v4 | |
with: | |
path: repo | |
- name: Checkout ScratchAddons/website-v2-script | |
uses: actions/checkout@v4 | |
with: | |
repository: ScratchAddons/website-v2-script | |
path: script | |
- name: Checkout ScratchAddons/website-v2 | |
uses: actions/checkout@v4 | |
with: | |
repository: ScratchAddons/website-v2 | |
path: website | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache Node.js dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node- | |
- name: Execute script | |
id: script | |
run: | | |
echo Running... | |
cd repo | |
bash ../script/sh/i18n-update-source.sh | |
- name: Generate token | |
if: steps.script.outputs.has_new_commit == 'true' | |
uses: tibdex/github-app-token@v2 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.BOT_APP_ID }} | |
private_key: ${{ secrets.BOT_PRIVATE_KEY }} | |
- name: Invoke workflow | |
if: steps.script.outputs.has_new_commit == 'true' | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: Source Upload | |
token: ${{ steps.generate-token.outputs.token }} |