Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/deploy_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ jobs:
- name: Release Package
run: bundle exec fastlane ${{ inputs.type }}

- name: Release docs
if: ${{ inputs.type == 'release' }}
working-directory: ${{ github.workspace }}
run: |
git checkout -B gh-pages
bash ./scripts/jazzy_doc_gen.sh
release-docs:
name: Release documentation
if: ${{ inputs.type == 'release' }}
needs: [release]
permissions:
contents: read
pages: write
id-token: write
uses: ./.github/workflows/release_doc.yml
13 changes: 8 additions & 5 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ jobs:
- name: Release Package
run: bundle exec fastlane release

- name: Release docs
working-directory: ${{ github.workspace }}
run: |
git checkout -B gh-pages
bash ./scripts/jazzy_doc_gen.sh
release-docs:
name: Release documentation
needs: [release]
permissions:
contents: read
pages: write
id-token: write
uses: ./.github/workflows/release_doc.yml
94 changes: 78 additions & 16 deletions .github/workflows/release_doc.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
name: Deploy Documentation
on:
workflow_call:
workflow_dispatch:

permissions:
contents: write
contents: read

jobs:
release-doc:
name: Release documentation
generate-doc:
name: Generate documentation
if: ${{ github.ref_name == 'release' }}
runs-on: macos-latest
environment: Release
outputs:
sha: ${{ steps.commit.outputs.sha }}
steps:
- name: Generate GitHub App token
id: retrieve-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: Iv23lil6abCFOvhL0fxO
private-key: ${{ secrets.AWS_AMPLIFY_OPS_APP_PRIVATE_KEY }}
permission-contents: write

- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
token: ${{steps.retrieve-token.outputs.token}}
ref: release
persist-credentials: false

- name: Setup Ruby
uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0
Expand All @@ -32,7 +27,74 @@ jobs:
bundler-cache: true

- name: Generate doc
run: bundle exec jazzy --swift-build-tool spm

- name: Get commit
id: commit
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Upload doc
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: api-docs
path: docs
if-no-files-found: error

build-site:
name: Build site
needs: generate-doc
runs-on: ubuntu-latest
permissions:
contents: read
pages: read
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
ref: release
persist-credentials: false

- name: Check commit
env:
GITHUB_EMAIL: aws-amplify-ops@amazon.com
GITHUB_USER: aws-amplify-ops
run: bash ./scripts/jazzy_doc_gen.sh
DOC_SHA: ${{ needs.generate-doc.outputs.sha }}
run: |
if [ "$(git rev-parse HEAD)" != "$DOC_SHA" ]; then
echo "release moved after the docs were generated, run this workflow again"
exit 1
fi

- name: Remove docs folder
run: rm -rf docs

- name: Download doc
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: api-docs
path: docs

- name: Link readme images
run: ln -s ../readme-images docs/readme-images

- name: Build with Jekyll
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
with:
source: ./
destination: ./_site

- name: Upload site
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0

deploy:
name: Deploy site
needs: build-site
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
20 changes: 0 additions & 20 deletions scripts/jazzy_doc_gen.sh

This file was deleted.

Loading