Repository navigation
Update some github action versions. #752
This file contains hidden or 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: Build and Deploy | |
| on: | |
| - push | |
| # - repository_dispatch: | |
| # types: [slides-updated] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| # Show payload only for repository_dispatch | |
| # - name: Show dispatch payload | |
| # if: ${{ github.event_name == 'repository_dispatch' }} | |
| # run: | | |
| # echo "Event type: ${{ github.event.action || 'N/A' }}" | |
| # echo "Client payload (JSON):" | |
| # echo '${{ toJson(github.event.client_payload) }}' | |
| - name: Set timezone | |
| uses: szenius/set-timezone@v2.0 | |
| with: | |
| timezoneLinux: "America/New_York" | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| - name: Install dependencies | |
| run: | | |
| curl -Ls https://github.com/jgm/pandoc/releases/download/2.11.2/pandoc-2.11.2-1-amd64.deb -o pandoc.deb | |
| sudo dpkg -i pandoc.deb | |
| sudo apt-get install fonts-stix | |
| sudo apt-get install libunistring-dev | |
| - name: Install Racket | |
| uses: Bogdanp/setup-racket@v1.15 | |
| with: | |
| architecture: 'x64' | |
| distribution: 'full' | |
| variant: 'CS' | |
| version: '8.18' | |
| - name: Install a86, langs, and assignments | |
| run: | | |
| git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/a86.git | |
| git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/langs.git | |
| git clone --branch "${{ github.ref_name }}" --single-branch https://github.com/cmsc430/assignments.git | |
| raco pkg install --auto a86/ | |
| raco pkg install --auto langs/ | |
| raco pkg install --auto assignments/ | |
| - name: Build and test | |
| run: | | |
| export LINK_DIR=/usr/lib/x86_64-linux-gnu | |
| # raco pkg install --auto www/ | |
| raco make www/main.scrbl | |
| make -C www main | |
| - name: Download slides | |
| run: | | |
| gh api repos/cmsc430/slides/zipball/pdfs > pdfs.zip | |
| mkdir -p www/main/slides | |
| unzip -jq pdfs.zip '*.pdf' -d www/main/slides/ | |
| - name: Upload www for GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| name: github-pages | |
| path: www/main | |
| - name: Upload www as artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: site-static | |
| path: www/main | |
| if-no-files-found: error | |
| retention-days: 7 | |
| deploy-github-pages: | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Deploy to GitHub pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |