|
37 | 37 | - name: Build site |
38 | 38 | run: npm run build |
39 | 39 |
|
40 | | - - name: Verify legal routes in artifact |
41 | | - run: | |
42 | | - test -f dist/privacy_oliver/index.html |
43 | | - test -f dist/terms_oliver/index.html |
44 | | - test -f dist/privacy_oliver.html |
45 | | - test -f dist/terms_oliver.html |
46 | | - echo "Verified generated legal pages:" |
47 | | - ls -la dist/privacy_oliver dist/terms_oliver |
48 | | -
|
49 | 40 | - name: Upload artifact |
50 | 41 | uses: actions/upload-pages-artifact@v3 |
51 | 42 | with: |
|
61 | 52 | - name: Deploy to GitHub Pages |
62 | 53 | id: deployment |
63 | 54 | uses: actions/deploy-pages@v4 |
64 | | - |
65 | | - - name: Verify Pages configuration |
66 | | - env: |
67 | | - GH_TOKEN: ${{ github.token }} |
68 | | - run: | |
69 | | - response=$(curl -fsSL \ |
70 | | - -H "Authorization: Bearer ${GH_TOKEN}" \ |
71 | | - -H "Accept: application/vnd.github+json" \ |
72 | | - "https://api.github.com/repos/${{ github.repository }}/pages") |
73 | | - echo "$response" | jq '{html_url, cname, build_type, source}' |
74 | | - build_type=$(echo "$response" | jq -r '.build_type') |
75 | | - if [ "$build_type" != "workflow" ]; then |
76 | | - echo "Pages build_type is '$build_type' (expected 'workflow')." |
77 | | - exit 1 |
78 | | - fi |
79 | | -
|
80 | | - - name: Probe deployed legal route |
81 | | - run: | |
82 | | - echo "Page URL: ${{ steps.deployment.outputs.page_url }}" |
83 | | - base="${{ steps.deployment.outputs.page_url }}" |
84 | | - for i in 1 2 3 4 5; do |
85 | | - code=$(curl -s -o /dev/null -w "%{http_code}" "$base/privacy_oliver/" || true) |
86 | | - echo "Attempt $i -> /privacy_oliver/ HTTP $code" |
87 | | - if [ "$code" = "200" ]; then |
88 | | - exit 0 |
89 | | - fi |
90 | | - sleep 5 |
91 | | - done |
92 | | - echo "Deployed site did not serve /privacy_oliver/ as HTTP 200" |
93 | | - exit 1 |
0 commit comments