mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-12-03 06:26:41 +00:00
82 lines
3.3 KiB
YAML
82 lines
3.3 KiB
YAML
name: Production
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
deploy-v2-vercel:
|
|
name: Deploy v2 to Vercel (production)
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: 2v-production
|
|
url: ${{ steps.deploy.outputs.deployment-url }}
|
|
outputs:
|
|
deployment-url: ${{ steps.deploy.outputs.deployment-url }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Deploy
|
|
id: deploy
|
|
uses: ./.github/composite/deploy-vercel
|
|
with:
|
|
environment: production
|
|
vercelOrg: ${{ secrets.VERCEL_ORG_ID }}
|
|
vercelProject: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
vercelToken: ${{ secrets.VERCEL_TOKEN }}
|
|
opItem: op://gitbook-open/2v-production
|
|
opServiceAccount: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
deploy-v2-cloudflare:
|
|
name: Deploy v2 to Cloudflare Worker (production)
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: 2c-production
|
|
url: ${{ steps.deploy.outputs.deployment-url }}
|
|
outputs:
|
|
deployment-url: ${{ steps.deploy.outputs.deployment-url }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Deploy
|
|
id: deploy
|
|
uses: ./.github/composite/deploy-cloudflare
|
|
with:
|
|
environment: production
|
|
deploy: true
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
opItem: op://gitbook-open/2c-production
|
|
opServiceAccount: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
|
|
commitTag: main
|
|
commitMessage: ${{ github.sha }}
|
|
- name: Outputs
|
|
run: |
|
|
echo "URL: ${{ steps.deploy.outputs.deployment-url }}"
|
|
linear-release:
|
|
name: Track the production release in Linear
|
|
needs: [deploy-v2-vercel, deploy-v2-cloudflare]
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
# Release tracking must never fail a deployment that already succeeded.
|
|
continue-on-error: true
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
LINEAR_ACCESS_KEY: ${{ secrets.PRODUCTION_LINEAR_RELEASE_ACCESS_KEY }}
|
|
steps:
|
|
- name: Skip release tracking without an access key
|
|
if: env.LINEAR_ACCESS_KEY == ''
|
|
run: echo "::warning::No Linear pipeline access key is configured, skipped tracking the release."
|
|
- name: Checkout
|
|
if: env.LINEAR_ACCESS_KEY != ''
|
|
uses: actions/checkout@v4
|
|
with:
|
|
# The Linear CLI scans commit metadata since the last release, so it needs history but no blobs.
|
|
fetch-depth: 0
|
|
filter: blob:none
|
|
persist-credentials: false
|
|
- name: Sync the release to Linear
|
|
if: env.LINEAR_ACCESS_KEY != ''
|
|
uses: linear/linear-release-action@dd4fc407f860b9460d2cf0b3fb1edd8985cf443f # v0.18.2
|
|
with:
|
|
access_key: ${{ env.LINEAR_ACCESS_KEY }}
|