|
| 1 | +name: Production Deploy (main) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + pages: write |
| 10 | + id-token: write |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: pages-prod |
| 14 | + cancel-in-progress: false |
| 15 | + |
| 16 | +env: |
| 17 | + SERVICES_URL: https://api.t-pen.org |
| 18 | + RERUM_URL: https://store.rerum.io/v1 |
| 19 | + |
| 20 | +jobs: |
| 21 | + smoke: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - name: Checkout |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Set TPEN_ENV=prod |
| 28 | + run: echo "TPEN_ENV=prod" >> $GITHUB_ENV |
| 29 | + |
| 30 | + - name: Generate runtime env file (prod) |
| 31 | + run: echo "window.TPEN_ENV='prod'" > config.env.js |
| 32 | + |
| 33 | + - name: Install curl and jq |
| 34 | + run: sudo apt-get update && sudo apt-get install -y curl jq |
| 35 | + |
| 36 | + - name: Smoke test TPEN services API health |
| 37 | + run: | |
| 38 | + set -e |
| 39 | + echo "Testing $SERVICES_URL API availability" |
| 40 | + # Simple HEAD check to verify API is responding |
| 41 | + curl -fsI --retry 3 --retry-delay 2 "$SERVICES_URL" >/dev/null || { |
| 42 | + echo "API health check failed - $SERVICES_URL not responding" |
| 43 | + exit 1 |
| 44 | + } |
| 45 | + echo "✓ TPEN services API is reachable" |
| 46 | +
|
| 47 | + - name: Smoke test RERUM store reachability |
| 48 | + run: | |
| 49 | + set -e |
| 50 | + echo "HEAD $RERUM_URL" |
| 51 | + curl -fsI --retry 3 --retry-delay 2 "$RERUM_URL" >/dev/null |
| 52 | +
|
| 53 | + build: |
| 54 | + needs: smoke |
| 55 | + runs-on: ubuntu-latest |
| 56 | + env: |
| 57 | + TPEN_ENV: prod |
| 58 | + steps: |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@v4 |
| 61 | + |
| 62 | + - name: Ensure TPEN_ENV=prod |
| 63 | + run: echo "TPEN_ENV=prod" >> $GITHUB_ENV |
| 64 | + |
| 65 | + - name: Setup Pages |
| 66 | + uses: actions/configure-pages@v5 |
| 67 | + |
| 68 | + - name: Build with Jekyll |
| 69 | + uses: actions/jekyll-build-pages@v1 |
| 70 | + with: |
| 71 | + source: ./ |
| 72 | + destination: ./_site |
| 73 | + |
| 74 | + - name: Upload artifact |
| 75 | + uses: actions/upload-pages-artifact@v3 |
| 76 | + with: |
| 77 | + path: _site |
| 78 | + |
| 79 | + deploy: |
| 80 | + needs: build |
| 81 | + runs-on: ubuntu-latest |
| 82 | + environment: |
| 83 | + name: github-pages |
| 84 | + url: ${{ steps.deployment.outputs.page_url }} |
| 85 | + steps: |
| 86 | + - name: Deploy to GitHub Pages (Production) |
| 87 | + id: deployment |
| 88 | + uses: actions/deploy-pages@v4 |
0 commit comments