diff --git a/.github/workflows/workflow-vercel-deployment.yml b/.github/workflows/workflow-vercel-deployment.yml index f9984979..33ab8f40 100644 --- a/.github/workflows/workflow-vercel-deployment.yml +++ b/.github/workflows/workflow-vercel-deployment.yml @@ -1,7 +1,5 @@ name: Vercel Static Frontend Deployment - - on: workflow_call: inputs: @@ -13,7 +11,6 @@ on: type: string description: 'Deployment environment (dev, prd, uat)' - env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} @@ -29,15 +26,31 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + + - name: checkout code + uses: actions/checkout@v3 + + - name: install node + uses: actions/setup-node@v3 + with: + cache: npm + node-version-file: "package.json" + + - name: install npm + run: npm install -g npm@9.8.1 + - name: Install Vercel CLI run: npm install --global vercel@latest + - name: Pull Vercel Environment Information run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + - name: Build Project Artifacts run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + - name: Deploy Project Artifacts to Vercel run: echo "DEPLOYMENT_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_ENV + - name: Set URL to dev environment run: vc alias "$DEPLOYMENT_URL" ${{ env.VERCEL_PROJECT_NAME }}-${{ env.DEPLOYMENT_ENVIRONMENT }}.vercel.app --token=${{ secrets.VERCEL_TOKEN }}