diff --git a/.github/workflows/docker.yml b/.github/workflows/release.yml similarity index 51% rename from .github/workflows/docker.yml rename to .github/workflows/release.yml index b8d1773c..d1e6d58b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,4 @@ -# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages -name: Create and publish a Docker image +name: Deploy Production environment on Vercel and Publish Docker image on: push: branches: ['main'] @@ -9,6 +8,38 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + vercel-job: + runs-on: ubuntu-latest + # Update the "Production" environment with the Vercel deployed URL + environment: + name: Production + url: ${{ steps.vercel-deploy.outputs.deployment_url }} + steps: + - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - id: vercel-deploy + run: | + npx -y vercel deploy --target=production --token=${{ secrets.VERCEL_TOKEN }} \ + --build-env MDX=docs \ + --build-env NEXT_PUBLIC_LIBNAME="Poimandres" \ + --build-env NEXT_PUBLIC_LIBNAME_SHORT="pmndrs" \ + --build-env BASE_PATH= \ + --build-env DIST_DIR= \ + --build-env OUTPUT= \ + --build-env HOME_REDIRECT= \ + --build-env MDX_BASEURL="https://github.com/${{ github.repository }}/raw/${{ github.head_ref }}/docs" \ + --build-env EDIT_BASEURL="https://github.com/${{ github.repository }}/edit/${{ github.head_ref }}/docs" \ + --build-env NEXT_PUBLIC_URL="$VERCEL_PROJECT_PRODUCTION_URL" \ + --build-env ICON= \ + --build-env LOGO=gutenberg.jpg \ + > deployment-url.txt + + echo "deployment_url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + + # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages build-and-push-image: runs-on: ubuntu-latest