Update deploy.yml #7
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: Gh Pages Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Detect changes and run build | |
id: detect-changes | |
run: | | |
# CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }}) | |
# echo "Changed files: $CHANGED_FILES" | |
# WEEKS=("week1" "week2") | |
# for WEEK in "${WEEKS[@]}"; do | |
# if [ -d "$WEEK" ]; then # 해당 주차 폴더가 존재하는지 확인 | |
# echo "Checking projects in $WEEK" | |
# # 해당 주차 폴더 하위의 모든 프로젝트 폴더를 읽어서 순회 | |
# for PROJECT in $(ls -d $WEEK/*/); do | |
# PROJECT=${PROJECT%/} # 디렉토리 이름에서 마지막 '/' 제거 | |
# if echo "$CHANGED_FILES" | grep -q "$PROJECT/"; then | |
# echo "Running build for $PROJECT" | |
# pnpm --filter "$PROJECT" build | |
# fi | |
# done | |
# fi | |
# done | |
pnpm build | |
deploy: | |
permissions: | |
id-token: write | |
pages: write | |
environment: | |
name: github-pages | |
url: "https://konkuk-kuit.github.io/KUIT4_Web-FrontEnd" | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |