1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-13 17:18:37 +02:00
nerd-fonts/.github/workflows/pages.yml
Fini Jastrow 83d41b6220 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>
2022-10-18 20:47:29 +02:00

46 lines
1.1 KiB
YAML

name: Update gh-pages
on:
push:
branches: [ master ]
paths:
- bin/scripts/lib/fonts.json
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Fetch files
uses: Bhacaz/checkout-files@v2
with:
files: bin/scripts/lib/fonts.json
branch: ${{ github.sha }}
- name: Prepare file
run: |
echo "Temp dir is /tmp"
cp bin/scripts/lib/fonts.json /tmp
ls -l /tmp/fonts.json
- name: Fetch gh-pages
uses: actions/checkout@v3
with:
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
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: temp_data
target-folder: _data
commit-message: "[ci] Sync fonts.json"
git-config-name: GitHub Actions
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
clean: false