Project List on Syllabus #156
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
# .github/workflows/deploy-docs.yml | |
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 Dependencies | |
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 Website | |
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 |