1name: Docs Website 2 3defaults: 4 run: 5 shell: bash 6 working-directory: docs 7 8on: 9 workflow_dispatch: {} 10 push: 11 branches: [main] 12 paths: 13 - 'docs/**' 14 - '.github/workflows/docs.yml' 15 pull_request: 16 paths: 17 - 'docs/**' 18 - '.github/workflows/docs.yml' 19 20concurrency: 21 group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} 22 cancel-in-progress: true 23 24jobs: 25 docs: 26 runs-on: ubuntu-20.04 27 steps: 28 - name: Checkout 29 uses: actions/checkout@v3 30 with: 31 submodules: true 32 - name: ⬢ Setup Node 33 uses: actions/setup-node@v3 34 with: 35 node-version: '14.17' 36 - name: ♻️ Restore caches 37 uses: ./.github/actions/expo-caches 38 id: expo-caches 39 with: 40 yarn-docs: 'true' 41 - name: ➕ Add `bin` to GITHUB_PATH 42 run: echo "$(pwd)/bin" >> $GITHUB_PATH 43 - name: Yarn install 44 if: steps.expo-caches.outputs.yarn-docs-hit != 'true' 45 run: yarn install --frozen-lockfile 46 - name: Run Docs tests 47 run: yarn test 48 - name: Lint Docs app 49 run: yarn lint --max-warnings 0 50 - name: Lint Docs content 51 run: yarn lint-case 52 - run: yarn danger ci 53 env: 54 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 55 - name: ️ Build Docs website for deploy 56 run: yarn export 57 timeout-minutes: 20 58 env: 59 USE_ESBUILD: 1 60 # TODO(cedric): If we have time, we should make sure all links are valid and connected to a proper header 61 # - name: lint links 62 # run: yarn lint-links --quiet 63 - name: ✅ Test links (legacy) 64 run: | 65 yarn export-server & 66 while ! nc -z localhost 8000; do 67 sleep 1 68 done 69 yarn test-links http://127.0.0.1:8000 70 timeout-minutes: 1 71 - name: Deploy Docs website 72 if: ${{ github.event.ref == 'refs/heads/main' }} 73 run: ./deploy.sh 74 env: 75 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 76 AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 77 AWS_DEFAULT_REGION: 'us-east-2' 78 - name: Notify on Slack 79 uses: 8398a7/action-slack@v3 80 if: failure() && github.event.ref == 'refs/heads/main' 81 env: 82 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 83 SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_docs }} 84 with: 85 channel: '#docs' 86 status: ${{ job.status }} 87 fields: job,message,ref,eventName,author,took 88 author_name: Docs 89