Update prod-deploy.yml #3
This file contains hidden or 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: Production Deploy (main) | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages-prod | |
| cancel-in-progress: false | |
| env: | |
| SERVICES_URL: https://api.t-pen.org | |
| RERUM_URL: https://store.rerum.io/v1 | |
| jobs: | |
| smoke: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set ACTIVE_ENV=prod | |
| run: | | |
| sed -i "s/^export const ACTIVE_ENV = .*/export const ACTIVE_ENV = 'prod' \/\/ 'dev' | 'prod'/" api/config.js | |
| echo "Configured ACTIVE_ENV to prod" && grep -n "ACTIVE_ENV" api/config.js | |
| - name: Install curl and jq | |
| run: sudo apt-get update && sudo apt-get install -y curl jq | |
| - name: Smoke test TPEN services API health | |
| run: | | |
| set -e | |
| echo "Testing $SERVICES_URL API availability" | |
| # Simple HEAD check to verify API is responding | |
| curl -fsI --retry 3 --retry-delay 2 "$SERVICES_URL" >/dev/null || { | |
| echo "API health check failed - $SERVICES_URL not responding" | |
| exit 1 | |
| } | |
| echo "✓ TPEN services API is reachable" | |
| - name: Smoke test RERUM store reachability | |
| run: | | |
| set -e | |
| echo "HEAD $RERUM_URL" | |
| curl -fsI --retry 3 --retry-delay 2 "$RERUM_URL" >/dev/null | |
| build: | |
| needs: smoke | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Ensure ACTIVE_ENV=prod | |
| run: | | |
| sed -i "s/^export const ACTIVE_ENV = .*/export const ACTIVE_ENV = 'prod' \/\/ 'dev' | 'prod'/" api/config.js | |
| grep -n "ACTIVE_ENV" api/config.js | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build with Jekyll | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: ./ | |
| destination: ./_site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages (Production) | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |