diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml new file mode 100644 index 000000000..bfbb68210 --- /dev/null +++ b/.github/workflows/ci-docs.yml @@ -0,0 +1,28 @@ +name: ci docs +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main + paths: + - 'docs/site/**' +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Install PNPM + uses: pnpm/action-setup@v3 + with: + version: 8 + - name: Install Vercel CLI + run: pnpm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/ci-pr-docs.yml b/.github/workflows/ci-pr-docs.yml new file mode 100644 index 000000000..b81c44721 --- /dev/null +++ b/.github/workflows/ci-pr-docs.yml @@ -0,0 +1,48 @@ +name: ci pr docs +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + pull_request: + paths: + - 'docs/site/**' +jobs: + deploy: + runs-on: ubuntu-latest + outputs: + url: ${{ steps.deploy.outputs.deployment_url }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Install PNPM + uses: pnpm/action-setup@v3 + with: + version: 8 + - name: Install Vercel CLI + run: pnpm install --global vercel@latest + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts + run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel + id: deploy + run: echo "deployment_url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT + comment: + needs: deploy + runs-on: ubuntu-latest + steps: + - name: Comment PR with Deployment URL + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const deployment_url = '${{ needs.deploy.outputs.url }}'; + const pr_number = context.payload.pull_request.number; + const repository = context.repo.repo; + const owner = context.repo.owner; + github.rest.issues.createComment({ + owner: owner, + repo: repository, + issue_number: pr_number, + body: `Docs preview complete 🚀 see it here: ${deployment_url}` + }); diff --git a/docs/site/.gitkeep b/docs/site/.gitkeep new file mode 100644 index 000000000..e69de29bb