daily dose of papers #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Site | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages branch to root | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Checkout main branch to pyqs | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
clean: false | |
path: pyqs | |
# - name: Remove hidden files and directories from pyqs directory | |
# run: sudo find pyqs -mindepth 1 -name ".*" -prune -exec rm -rf {} \; && sudo find pyqs -mindepth 1 -name "_*" -prune -exec rm -rf {} \; && sudo find pyqs -maxdepth 1 -type f -exec rm -f {} \; | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "latest" | |
- name: Generate .md with python | |
run: python generate.py | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Build with Jekyll v4 | |
uses: dunkmann00/jekyll-v4-build-pages@v2 | |
with: | |
source: "./" | |
destination: "./_site" | |
# - name: Move all files and folders from /_site/pyqs to /_site | |
# run: sudo rsync -a _site/pyqs/ _site/ && sudo rm -r _site/pyqs/* | |
- name: Minify HTML,CSS and JS | |
run: bash minify.sh | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: "./_site" | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
- name: Clear build artifacts | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: github-pages |