From b91a1d682a022e9cd0b1849de2ef3fbe9df7cb06 Mon Sep 17 00:00:00 2001 From: Jonas Dujava Date: Wed, 2 Oct 2024 14:48:25 +0200 Subject: [PATCH] ci(gh-pages): wip Signed-off-by: Jonas Dujava --- .github/workflows/main.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5b4078..7e26287 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 @@ -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