Skip to content

Update build-and-deployment.yml #7

Update build-and-deployment.yml

Update build-and-deployment.yml #7

name: 문서 배포
on:
# "master" 브랜치에 푸시할 때 마다 워크플로우 작동
push:
branches: [ "master" ]
workflow_dispatch:
# GitHub Pages 에 배포하기 위한 GITHUB_TOKEN 권한 설정
permissions:
contents: read
pages: write
id-token: write
# 동시성 배포 허용
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
environment:
# GitHub Pages 로 배포하기 위한 필수 설정
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-15 #최신버전
steps:
- name: 체크아웃 🛎️
uses: actions/checkout@v3
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1 # xcode 버전 설정을 위함
with:
xcode-version: '16.0'
- name: DocC 문서 빌드
run: |
xcodebuild -scheme blog -destination 'platform=macOS' \
-derivedDataPath /tmp/docbuild \
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/swift-docc-blog.doccarchive \
--hosting-base-path swift-docc-blog \
--output-path docs;
echo "<script>window.location.href += \"/documentation/blog\"</script>" > docs/index.html
- name: artifact 업로드
uses: actions/upload-pages-artifact@v3
with:
# docs 경로에 있는 것만 업로드
path: 'docs'
- name: GitHub Pages 에 배포
id: deployment
uses: actions/deploy-pages@v1