Skip to content

Commit

Permalink
chore: merging preview.yml and release.yml workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Aug 29, 2024
1 parent 9ed6731 commit b2dae2d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 56 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/preview.yml

This file was deleted.

19 changes: 11 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Deploy Production environment on Vercel and Publish Docker image
name: Deploy on Vercel and Publish Docker image
on:
push:
branches: ['main']
pull_request:
branches: ['main']

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -31,28 +33,29 @@ jobs:
needs: semantic-release-job
if: needs.semantic-release-job.outputs.new_release_version != ''

# Update the "Production" environment with the Vercel deployed URL
# Update the "Production"/"Preview" environment with the Vercel deployed URL
environment:
name: Production
name: ${{ github.event_name == 'push' && 'Production' || 'Preview' }}
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 }} \
npx -y vercel deploy --token=${{ secrets.VERCEL_TOKEN }} \
--target=${{ github.event_name == 'push' && 'production' || 'preview' }} \
--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 OUTPUT=${{ github.event_name == 'push' && '' || 'export' }} \
--build-env HOME_REDIRECT= \
--build-env MDX_BASEURL="https://github.com/${{ github.repository }}/raw/${{ github.ref_name }}/docs" \
--build-env EDIT_BASEURL="https://github.com/${{ github.repository }}/edit/${{ github.ref_name }}/docs" \
--build-env MDX_BASEURL="https://github.com/${{ github.repository }}/raw/${{ github.event_name == 'push' && github.ref_name || github.head_ref }}/docs" \
--build-env EDIT_BASEURL="https://github.com/${{ github.repository }}/edit/${{ github.event_name == 'push' && github.ref_name || github.head_ref }}/docs" \
--build-env NEXT_PUBLIC_URL="$VERCEL_PROJECT_PRODUCTION_URL" \
--build-env ICON= \
--build-env ICON=${{ github.event_name == 'push' && '' || '🖨️' }} \
--build-env LOGO=gutenberg.jpg \
--build-env GITHUB="https://github.com/${{ github.repository }}" \
--build-env DISCORD="${{ secrets.DISCORD }}" \
Expand Down
10 changes: 10 additions & 0 deletions release.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/** @type {import('semantic-release').GlobalConfig} */
const config = {
branches: [
'+([0-9])?(.{+([0-9]),x}).x',
'master',
'main',
'next',
'next-major',
{ name: 'beta', prerelease: true },
{ name: 'alpha', prerelease: true },
{ name: 'canary-*', prerelease: true },
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
Expand Down

0 comments on commit b2dae2d

Please sign in to comment.