과학기술인공제회 보안프로그램 수정 #102
This file contains hidden or 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: Deploy Docs to GitHub Pages with Catalog Builder Tool | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/**' | |
| - 'docs/**' | |
| - 'src/**' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Setup .NET Core SDK | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.x | |
| # Run Catalog Builder tool | |
| - name: Run Catalog Builder Tool | |
| run: dotnet run --file src/catalogutil.cs -- ./docs/ ./outputs/ | |
| # Create build info file | |
| - name: Create Build Info | |
| run: | | |
| mkdir -p ./outputs/ | |
| cat > ./outputs/build-info.json << EOF | |
| { | |
| "commit_id": "${{ github.sha }}", | |
| "short_commit_id": "${GITHUB_SHA:0:7}", | |
| "build_timestamp": "$(date -u '+%Y-%m-%dT%H:%M:%SZ')", | |
| "repository": "${{ github.repository }}", | |
| "branch": "${{ github.ref_name }}", | |
| "workflow_run_id": "${{ github.run_id }}" | |
| } | |
| EOF | |
| # Setup XSLT tools | |
| - name: Setup XSLT tool | |
| run: sudo apt-get update && sudo apt-get install -y xsltproc | |
| # Transform XML to HTML with XSL | |
| - name: Transform XML to HTML | |
| run: xsltproc docs/Catalog.xsl docs/Catalog.xml > ./outputs/index.html | |
| # Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./outputs | |
| publish_branch: gh-pages |