Skip to content

Commit

Permalink
chore: gha vercel production deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Aug 17, 2024
1 parent c978a50 commit d048e46
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/docker.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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']
Expand All @@ -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

Expand Down

0 comments on commit d048e46

Please sign in to comment.