Skip to content

Kopier fil til gh-pages #13

Kopier fil til gh-pages

Kopier fil til gh-pages #13

name: Kopier fil til gh-pages
on:
workflow_run:
workflows: ["01 Build and Deploy Site"]
types:
- completed
jobs:
kopier-fil:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
- name: Download fil fra internettet
run: curl -o logotest.svg https://kubdatalab.github.io/R-intro/fig/logotest.svg
- name: Kopier fil til det bestemte sted
run: mv logotest.svg assets/images/library-logo.svg
- name: Hent favicons fra R-intro (gh-pages) og kopier til favicons/lc
run: |
set -e
TMPDIR="$(mktemp -d)"
git clone --depth=1 --branch gh-pages https://github.com/KUBDatalab/R-intro "$TMPDIR"
if [ -d "$TMPDIR/fig/favico" ]; then
SRC_DIR="$TMPDIR/fig/favico"
elif [ -d "$TMPDIR/fig/favicon" ]; then
SRC_DIR="$TMPDIR/fig/favicon"
else
echo "Ingen fig/favico eller fig/favicon på gh-pages" >&2
find "$TMPDIR" -maxdepth 2 -type d >&2
exit 1
fi
mkdir -p favicons/lc
# Hvis du vil starte rent hver gang, så fjern kommentaren på næste linje:
# rm -rf favicons/lc/*
# Kopiér alt indhold; overskriver filer med samme navn i mål
cp -a "$SRC_DIR/." favicons/lc/
- name: Commit og push ændringer
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add .
git commit -m "Opdateret fil på gh-pages"
git push