-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 2.07 KB
/
deploy.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
50
51
52
53
54
55
56
57
58
59
60
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deploy Docs
on:
push:
branches: [ "main" ]
jobs:
deploy:
runs-on: ubuntu-latest
env:
GIT_USER: ${{secrets.USER}}
GIT_PASS: ${{secrets.TOKEN}}
steps:
- uses: actions/checkout@v3
- name: Install
run: cd documentation && yarn install
- name: Determine Semester
id: semester
run: |
CURRENT_MONTH=$(date +%-m)
CURRENT_YEAR=$(date +%Y)
if [[ "$CURRENT_MONTH" -ge 1 && "$CURRENT_MONTH" -le 5 ]]; then
SEMESTER="Spring"
elif [[ "$CURRENT_MONTH" -ge 8 && "$CURRENT_MONTH" -le 12 ]]; then
SEMESTER="Fall"
else
SEMESTER="Summer"
fi
echo "SEMESTER_YEAR=${SEMESTER} ${CURRENT_YEAR}" >> $GITHUB_ENV
- name: Deploy
run: |
export ORG_NAME=$(echo ${GITHUB_REPOSITORY%/*})
export PROJECT_NAME=$(echo ${GITHUB_REPOSITORY#*/})
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
cd documentation && yarn deploy
- name: Make PDF
run: |
export PROJECT_NAME=$(echo ${GITHUB_REPOSITORY#*/})
cd documentation
yarn pdf
- name: Combine PDFs
uses: amoeba/combine-pdf-action@v1
with:
path: resources
- name: Rename PDF
run: |
mv resources/combined.pdf syllabus.pdf
- name: Upload PDF to Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: "${{ github.run_number }}"
name: ${{ env.SEMESTER_YEAR }} Course Syllabus
files: syllabus.pdf
draft: false
prerelease: false