1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-25 03:32:02 +02:00

CI: Fix workflow for the gh-pages (still ongoning?) [skip ci]

[why]
checkout-files checks out the last version on the push target branch,
not the version we actually pushed.

checkout clears all the workspace, so out file we want to commit is
lost.

[how]
Use commit hash from just pushed commit.

Use temporary directory outside of workspace to store the file.
Unfortunately we haved to copy back because github-pages-deploy-action
seems to take no absolute paths.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-10-18 20:47:29 +02:00
parent 7860afd295
commit 83d41b6220

View File

@ -5,6 +5,7 @@ on:
branches: [ master ] branches: [ master ]
paths: paths:
- bin/scripts/lib/fonts.json - bin/scripts/lib/fonts.json
workflow_dispatch:
jobs: jobs:
sync: sync:
@ -14,22 +15,30 @@ jobs:
uses: Bhacaz/checkout-files@v2 uses: Bhacaz/checkout-files@v2
with: with:
files: bin/scripts/lib/fonts.json files: bin/scripts/lib/fonts.json
branch: ${{ github.head_ref || github.ref_name }} branch: ${{ github.sha }}
- name: Prepare file - name: Prepare file
run: | run: |
mkdir _data echo "Temp dir is /tmp"
cp bin/scripts/lib/fonts.json _data cp bin/scripts/lib/fonts.json /tmp
ls -l /tmp/fonts.json
- name: Fetch gh-pages - name: Fetch gh-pages
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: gh-pages ref: gh-pages
- name: Prepare file 2
run: |
ls -l /tmp/fonts.json
mkdir temp_data
cp /tmp/fonts.json temp_data
- name: Deploy to gh-pages - name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4 uses: JamesIves/github-pages-deploy-action@v4
with: with:
folder: _data folder: temp_data
target-folder: _data
commit-message: "[ci] Sync fonts.json" commit-message: "[ci] Sync fonts.json"
git-config-name: GitHub Actions git-config-name: GitHub Actions
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com git-config-email: 41898282+github-actions[bot]@users.noreply.github.com