diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 073568d6..66155b1f 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -11,17 +11,19 @@ on: permissions: contents: read - pages: write - id-token: write concurrency: - group: pages + group: vercel-production cancel-in-progress: true jobs: - build: + deploy: runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 20 + environment: + name: production + url: https://gosqlx.dev + steps: - uses: actions/checkout@v4 @@ -44,24 +46,26 @@ jobs: cache: 'npm' cache-dependency-path: website/package-lock.json - - name: Install and build website - run: | - cd website - npm ci - npm run build + - name: Install Vercel CLI + run: npm install -g vercel@latest - - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: website/dist + - name: Pull Vercel environment + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + working-directory: website + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} - deploy: - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Build with Vercel + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + working-directory: website + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + + - name: Deploy to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} + working-directory: website + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} diff --git a/website/public/CNAME b/website/public/CNAME new file mode 100644 index 00000000..bd782d3b --- /dev/null +++ b/website/public/CNAME @@ -0,0 +1 @@ +gosqlx.dev \ No newline at end of file