Skip to content

Commit

Permalink
feat: docs deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomedina248 committed Aug 17, 2023
1 parent ded4cfe commit 1b7fe40
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-docs.yml
@@ -0,0 +1,42 @@
name: "Deploy Clutch docs to vercel"
on:
push:
paths:
- docs/**
- .github/workflows/deploy-docs.yml
jobs:
check-bats-version:
runs-on: ubuntu-latest
steps:
- name: Vercel CLI
shell: bash
run: |
cd docs
pnpm install --global vercel@latest
- name: Vercel Pull
shell: bash
run: |
cd docs
vercel pull --token ${{ secrets.VERCEL_CI_TOKEN }} --scope clutch-creator --yes
- name: Build
shell: bash
run: |
cd docs
vercel build --token ${{ secrets.VERCEL_CI_TOKEN }} --prod
- name: Deploy
shell: bash
run: |
cd docs
vercel deploy --prod --prebuilt --token ${{ secrets.VERCEL_CI_TOKEN }} --scope clutch-creator --yes
- name: Update deployment domain
shell: bash
run: |
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" --location 'https://api.vercel.com/v9/projects/docs/domains/docs.clutch.show?teamId=clutch-creator' --header 'Authorization: Bearer ${{ secrets.VERCEL_CI_TOKEN }}')
if [ $STATUS_CODE -eq 200 ]; then
echo "Domain already exists"
exit 0
fi
cd docs
vercel domains add 'docs.clutch.io' --token ${{ secrets.VERCEL_CI_TOKEN }} --scope clutch-creator

0 comments on commit 1b7fe40

Please sign in to comment.