Skip to content

Commit

Permalink
Implement the publish-pages.yml action
Browse files Browse the repository at this point in the history
  • Loading branch information
nik3212 committed Apr 30, 2024
1 parent e333aaf commit 6dcd3b6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 16 deletions.
31 changes: 31 additions & 0 deletions .github/actions/publish_pages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Page Action

inputs:
target:
required: true
type: string
base_path:
required: true
type: string

runs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Build DocC
run: |
swift build;
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target ${{ inputs.target }} \
--output-path ./docs \
--transform-for-static-hosting \
--hosting-base-path ${{ inputs.base_path }};
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
33 changes: 17 additions & 16 deletions .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

permissions:
contents: read
Expand All @@ -20,23 +25,19 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-12
strategy:
fail-fast: false
matrix:
include:
- target: "Flare"
base_path: "flare"
- destination: "FlareUI"
base_path: "flareui"
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Build DocC
run: |
swift build;
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target Flare \
--output-path ./docs \
--transform-for-static-hosting \
--hosting-base-path flare;
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- name: ${{ matrix.target }} DocC
uses: ./.github/actions/publish_pages
with:
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
target: ${{ matrix.target }}
base_path: ${{ matrix.base_path }}

0 comments on commit 6dcd3b6

Please sign in to comment.