btech papers #179
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.12" | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "latest" | |
- name: Generate .json with python | |
run: python generate_json.py | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Build Astro Site | |
run: npm install && npm run build | |
# - name: Minify HTML,CSS and JS | |
# run: bash minify.sh | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
name: github-pages | |
path: "./dist" | |
# 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 |