feat: SwiftDocC 카테고리 추가 및 TIL 추가 #29
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: Update Markdown Files and Deploy to Pages | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
update-markdown: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Run Swift script and check result | |
working-directory: ${{ github.workspace }} | |
run: | | |
if swift run Scripts; then | |
echo "Script executed successfully" | |
else | |
echo "Script execution failed" | |
exit 1 | |
fi | |
deploy: | |
runs-on: macos-latest | |
needs: update-markdown | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build Documentation | |
working-directory: ${{ github.workspace }} | |
run: | | |
swift package --allow-writing-to-directory ./docs \ | |
generate-documentation --target AriNote \ | |
--disable-indexing \ | |
--transform-for-static-hosting \ | |
--hosting-base-path TIL \ | |
--output-path ./docs | |
- name: Override Favicons | |
run: | | |
rm ./docs/favicon.svg | |
rm ./docs/favicon.ico | |
cp ./favicon.ico ./docs/favicon.ico | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'docs' | |
name: 'github-pages' | |
- name: Deploy to Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |