Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Cloudflare docs #70

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
39 changes: 24 additions & 15 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
name: Publish Docs Preview

on:
push:
branches:
- '**'
on: pull_request

permissions:
contents: read
deployments: write
id-token: write

env:
SLUG: portals-ios-api-ref-${{ github.event.number }}-${{ github.run_id }}

jobs:
publish-preview-docs:
runs-on: macos-12
timeout-minutes: 30
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
environment:
name: preview-${{ github.event.number }}
url: https://${{ env.SLUG }}.ionicpreview.com
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16.x
- run: sudo xcode-select --switch /Applications/Xcode_14.0.app
- uses: actions/checkout@v2
- name: Install Vercel CLI
run: npm install -g vercel
- name: Pull Build Configuration
run: vercel pull --token ${{ secrets.VERCEL_TOKEN }}
- name: Build Vercel Package
run: vercel build
- name: Deploy Preview
run: vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}
- name: Build Docs
run: xcodebuild docbuild -scheme IonicPortals -derivedDataPath DerivedData -destination 'platform=iOS Simulator,name=iPhone 14'
- name: Transform Docs
run: $(xcrun --find docc) process-archive transform-for-static-hosting DerivedData/Build/Products/Debug-iphonesimulator/IonicPortals.doccarchive --hosting-base-path docs/portals-ios-api-ref --output-path docs
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::319312831725:role/github-docs
aws-region: us-east-1
- name: Deploy
run: |
aws s3 sync docs s3://ionic-docs/preview/${{ env.SLUG }}/ --exclude '*.html' --cache-control max-age=31536000 --only-show-errors
aws s3 sync docs s3://ionic-docs/preview/${{ env.SLUG }}/ --exclude '*' --include '*.html' --cache-control max-age=60 --only-show-errors
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ yarn.lock

# Vitals
vitals/dist

docs/
9 changes: 0 additions & 9 deletions package.json

This file was deleted.