Publish expo-doctor #1
This file contains 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: Docs Website | |
defaults: | |
run: | |
shell: bash | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: [main] | |
paths: | |
- 'docs/**' | |
- '.github/workflows/docs.yml' | |
pull_request: | |
paths: | |
- '.github/workflows/docs.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docs: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 👀 Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: ⬢ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: ♻️ Restore caches | |
uses: ./.github/actions/expo-caches | |
id: expo-caches | |
with: | |
yarn-docs: 'true' | |
yarn-tools: 'true' | |
yarn-workspace: 'true' | |
- name: ➕ Add `bin` to GITHUB_PATH | |
run: echo "$(pwd)/bin" >> $GITHUB_PATH | |
- name: 📝 Regenerate `unversioned` data for Docs | |
run: expotools generate-docs-api-data | |
- name: 🧶 Yarn install | |
working-directory: docs | |
if: steps.expo-caches.outputs.yarn-docs-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: 🧪 Run Docs tests | |
working-directory: docs | |
run: yarn test | |
- name: 🚨 Lint Docs website code | |
working-directory: docs | |
env: | |
NODE_ENV: production | |
run: yarn lint --max-warnings 0 | |
- name: 💬 Lint Docs website content | |
working-directory: docs | |
run: yarn lint-prose | |
- name: 🏗️ Build Docs website for deploy | |
working-directory: docs | |
run: yarn export | |
timeout-minutes: 20 | |
- name: 🔗 Lint pages links | |
working-directory: docs | |
run: yarn lint-links --quiet | |
- name: ✅ Test links (legacy) | |
working-directory: docs | |
run: | | |
yarn export-server & | |
while ! nc -z localhost 8000; do | |
sleep 1 | |
done | |
yarn test-links http://127.0.0.1:8000 | |
timeout-minutes: 3 | |
- name: 🚀 Deploy Docs website | |
working-directory: docs | |
if: ${{ github.event.ref == 'refs/heads/main' }} | |
run: ./deploy.sh | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: 'us-east-2' | |
AWS_BUCKET: 'docs.expo.dev' | |
- name: 🔔 Notify on Slack | |
uses: 8398a7/action-slack@v3 | |
if: failure() && github.event.ref == 'refs/heads/main' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_docs }} | |
with: | |
channel: '#docs' | |
status: ${{ job.status }} | |
fields: job,message,ref,eventName,author,took | |
author_name: Docs |