Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ded4cfe
commit 1b7fe40
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |