-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
120 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 21 additions & 9 deletions
30
.github/workflows/staging-release.yml → .github/workflows/cicd-web.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |