-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.48 KB
/
check-assignment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
on: push
name: Check Assignment
jobs:
check-allowed-files:
runs-on: ubuntu-latest
container:
image: python:3.9-slim
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check Files
run: python check_allowed_files.py "hw-02.qmd" "hw-02.ipynb" "README.md" "data/*" "images/*" "check_allowed_files.py" "requirements.txt"
check-renders:
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}
runs-on: ubuntu-latest
container:
image: python:3.9-slim
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python and Quarto environment
run: |
apt-get update && apt-get install -y wget
wget -q -O quarto.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.1.189/quarto-1.1.189-linux-amd64.deb
dpkg -i quarto.deb
python -m pip install --upgrade pip
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Check if .qmd file exists
id: check_qmd
run: |
echo "QMD_EXISTS=false" >> $GITHUB_ENV
if [ -f hw-02.qmd ]; then
echo "QMD_EXISTS=true" >> $GITHUB_ENV
fi
- name: Render .qmd to HTML
if: env.QMD_EXISTS == 'true'
run: quarto render hw-02.qmd
- name: Render .ipynb to HTML
if: env.QMD_EXISTS == 'false'
run: quarto render hw-02.ipynb
- name: Create artifacts
uses: actions/upload-artifact@v2
with:
name: hw-02-html
path: hw-02.html