Skip to content

Commit

Permalink
feat: cicd 과정을 하나의 파일에 통일한다
Browse files Browse the repository at this point in the history
  • Loading branch information
guesung committed Oct 8, 2024
1 parent d46ee90 commit e91f15c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 120 deletions.
79 changes: 0 additions & 79 deletions .github/workflows/ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Release New Version
name: CICD Extension

on:
push:
tags:
- v*
branches:
- master
- develop
pull_request:
branches:
- master
- develop

permissions:
contents: write
Expand All @@ -28,11 +33,11 @@ jobs:
- name: build
run: pnpm run build:extension

- name: Zip the build files
run: pnpm run zip

- name: Upload zipped file on artifact
- name: Upload Extension
uses: actions/upload-artifact@v4
with:
name: extension
Expand All @@ -41,6 +46,7 @@ jobs:
upload-extension:
needs: build-extension
runs-on: ubuntu-22.04
if: ${{ startsWith(github.ref, 'refs/tags/v')}}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
Expand All @@ -64,30 +70,3 @@ jobs:
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes
build-web:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: setting environment variables
run: |
echo "${{ secrets.SHARED_ENV_FILE }}" >> packages/shared/.env
echo WEB_URL=${{ secrets.PROD_WEB_URL }} >> packages/shared/.env
echo "${{ secrets.WEB_ENV_FILE }}" > packages/web/.env
echo NEXT_PUBLIC_WEB_URL=${{ secrets.PROD_WEB_URL }} >> packages/web/.env
- name : Vercel Pull
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
run: |
VERCEL_DEPOLYED_URL="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel --prod --token=${{ secrets.VERCEL_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
name: Staging Release
name: CICD Extension

on:
push:
branches:
- 'develop'

- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build-web:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
- name: Install Vercel CLI
- name: Web Build
run: npm install --global vercel@latest
- name: setting environment variables
run: |
echo "${{ secrets.SHARED_ENV_FILE }}" >> packages/shared/.env
echo WEB_URL=${{ secrets.STAGING_WEB_URL }} >> packages/shared/.env
echo WEB_URL=${{ secrets.PROD_WEB_URL }} >> packages/shared/.env
echo "${{ secrets.WEB_ENV_FILE }}" > packages/web/.env
echo NEXT_PUBLIC_WEB_URL=${{ secrets.STAGING_WEB_URL }} >> packages/web/.env
echo NEXT_PUBLIC_WEB_URL=${{ secrets.PROD_WEB_URL }} >> packages/web/.env
- name : Vercel Pull
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
- name: Vercel Build
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
- name: Vercel Deploy on Staging
run: |
VERCEL_DEPOLYED_URL="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel alias set "$VERCEL_DEPOLYED_URL" ${{secrets.STAGING_WEB_URL_WITHOUT_PROTOCOL}} --token=${{ secrets.VERCEL_TOKEN }} --scope=gueit214s-projects
- name: Vercel Deploy on Production
if: github.ref == 'refs/tags/prod'
run: |
VERCEL_DEPOLYED_URL="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})"
vercel alias set "$VERCEL_DEPOLYED_URL" ${{secrets.STAGING_WEB_URL_WITHOUT_PROTOCOL}} --token=${{ secrets.VERCEL_TOKEN }} --scope=gueit214s-projects
vercel --prod --token=${{ secrets.VERCEL_TOKEN }}

0 comments on commit e91f15c

Please sign in to comment.