Skip to content

Commit

Permalink
ci(gh-pages): wip
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Dujava <jonas.dujava@gmail.com>
  • Loading branch information
jdujava committed Oct 2, 2024
1 parent 7db75ea commit b91a1d6
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ master ]
branches: [ master, improve-ci ]
pull_request:
branches: [ master ]
branches: [ master, improve-ci ]
workflow_dispatch:

## thanks to https://github.com/mff-cuni-cz/cuni-thesis-validator
Expand All @@ -26,7 +26,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Thesis
path: thesis.pdf
path: |
README.md
thesis.pdf
verify:
name: Verify PDF/A
runs-on: ubuntu-latest
Expand All @@ -39,24 +41,28 @@ jobs:
run: verify Thesis/*.pdf | tee /dev/stderr | grep -qE 'nonCompliant="0" failedJobs="0"'

deploy:
name: Deploy PDF to gh-pages branch
name: Deploy latest build of PDF and README.md to gh-pages branch
if: github.event_name == 'push' # only deploy on push
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Set up Git repository
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Get the PDF file from the artifact
uses: actions/download-artifact@v4
- name: Commit the PDF file
- name: Commit the PDF and README.md to `gh-pages` branch
run: |
cp Thesis/*.pdf .
cd Thesis
git init -b main
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add *.pdf
git commit --amend --no-edit
git push --force
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git add .
git commit -m "[CI] Update to latest PDF and README.md"
git push --force origin main:gh-pages
# cp Thesis/*.pdf .
# git config user.name github-actions[bot]
# git config user.email 41898282+github-actions[bot]@users.noreply.github.com
# git add *.pdf
# git commit --amend --no-edit
# git push --force

0 comments on commit b91a1d6

Please sign in to comment.