44 workflow_call :
55 inputs :
66 publish-web-apps-to-prod :
7- description : ' Publish web apps to prod'
7+ description : " Publish web apps to prod"
88 default : false
99 required : false
1010 type : boolean
@@ -21,15 +21,15 @@ jobs:
2121 contents : write
2222 id-token : write
2323 steps :
24- - name : ' Checkout'
24+ - name : " Checkout"
2525 uses : actions/checkout@v4
2626 with :
2727 fetch-depth : 0 # Checkout all branches and tags, needed for publish
28- - name : ' Use NodeJS 20'
28+ - name : " Use NodeJS 20"
2929 uses : actions/setup-node@v4
3030 with :
31- node-version : ' 20.11'
32- cache : ' npm'
31+ node-version : " 20.11"
32+ cache : " npm"
3333 - name : Install dependencies
3434 run : |
3535 npm ci
@@ -51,48 +51,57 @@ jobs:
5151 # with:
5252 # ## limits ssh access and adds the ssh public key for the user which triggered the workflow
5353 # limit-access-to-actor: true
54- - name : ' Deploy vite test-app site to Vercel'
54+ - name : " Deploy vite test-app site to Vercel"
5555 env :
5656 # Domain: experience-builder-test-app.colorfuldemo.com
5757 VERCEL_PROJECT_ID : prj_wr3mJgz9qLeHh33UaCFquePsr1hw
5858 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
59+ REF_NAME : ${{ github.ref_name }}
60+ PUBLISH_TO_PROD : ${{ inputs.publish-web-apps-to-prod }}
61+ VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
5962 run : |
60- if [ ${{ github.ref_name }} = main ] || [ ${{ inputs.publish-web-apps-to-prod }} = true ]; then
61- vercel pull --yes --environment=production --token=${{ secrets. VERCEL_TOKEN }}
62- vercel build --prod --token=${{ secrets. VERCEL_TOKEN }}
63- vercel deploy --prod --prebuilt --token=${{ secrets. VERCEL_TOKEN }}
63+ if [ "$REF_NAME" = " main" ] || [ "$PUBLISH_TO_PROD" = " true" ]; then
64+ vercel pull --yes --environment=production --token="$ VERCEL_TOKEN"
65+ vercel build --prod --token="$ VERCEL_TOKEN"
66+ vercel deploy --prod --prebuilt --token="$ VERCEL_TOKEN"
6467 else
65- vercel pull --yes --environment=preview --token=${{ secrets. VERCEL_TOKEN }}
66- vercel build --token=${{ secrets. VERCEL_TOKEN }}
67- vercel deploy --prebuilt --token=${{ secrets. VERCEL_TOKEN }}
68+ vercel pull --yes --environment=preview --token="$ VERCEL_TOKEN"
69+ vercel build --token="$ VERCEL_TOKEN"
70+ vercel deploy --prebuilt --token="$ VERCEL_TOKEN"
6871 fi
69- - name : ' Deploy nextjs-marketing-demo site to Vercel'
72+ - name : " Deploy nextjs-marketing-demo site to Vercel"
7073 env :
7174 # Domain: studio-nextjs-marketing-demo.colorfuldemo.com
7275 VERCEL_PROJECT_ID : prj_CQ1K4Pbkx5SQq2Fi9c4ZPHloOv79
7376 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
77+ REF_NAME : ${{ github.ref_name }}
78+ PUBLISH_TO_PROD : ${{ inputs.publish-web-apps-to-prod }}
79+ VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
7480 run : |
75- if [ ${{ github.ref_name }} = main ] || [ ${{ inputs.publish-web-apps-to-prod }} = true ]; then
76- vercel pull --yes --environment=production --token=${{ secrets. VERCEL_TOKEN }}
77- vercel build --prod --token=${{ secrets. VERCEL_TOKEN }}
78- vercel deploy --prod --prebuilt --token=${{ secrets. VERCEL_TOKEN }}
81+ if [ "$REF_NAME" = " main" ] || [ "$PUBLISH_TO_PROD" = " true" ]; then
82+ vercel pull --yes --environment=production --token="$ VERCEL_TOKEN"
83+ vercel build --prod --token="$ VERCEL_TOKEN"
84+ vercel deploy --prod --prebuilt --token="$ VERCEL_TOKEN"
7985 else
80- vercel pull --yes --environment=preview --token=${{ secrets. VERCEL_TOKEN }}
81- vercel build --token=${{ secrets. VERCEL_TOKEN }}
82- vercel deploy --prebuilt --token=${{ secrets. VERCEL_TOKEN }}
86+ vercel pull --yes --environment=preview --token="$ VERCEL_TOKEN"
87+ vercel build --token="$ VERCEL_TOKEN"
88+ vercel deploy --prebuilt --token="$ VERCEL_TOKEN"
8389 fi
84- - name : ' Deploy react vite template site to Vercel'
90+ - name : " Deploy react vite template site to Vercel"
8591 env :
8692 # Domain studio-react-vite-template.colorfuldemo.com
8793 VERCEL_PROJECT_ID : prj_HoAvIbgvZ3gYJDLCAaNsHIpBvI0k
8894 VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
95+ REF_NAME : ${{ github.ref_name }}
96+ PUBLISH_TO_PROD : ${{ inputs.publish-web-apps-to-prod }}
97+ VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
8998 run : |
90- if [ ${{ github.ref_name }} = main ] || [ ${{ inputs.publish-web-apps-to-prod }} = true ]; then
91- vercel pull --yes --environment=production --token=${{ secrets. VERCEL_TOKEN }}
92- vercel build --prod --token=${{ secrets. VERCEL_TOKEN }}
93- vercel deploy --prod --prebuilt --token=${{ secrets. VERCEL_TOKEN }}
99+ if [ "$REF_NAME" = " main" ] || [ "$PUBLISH_TO_PROD" = " true" ]; then
100+ vercel pull --yes --environment=production --token="$ VERCEL_TOKEN"
101+ vercel build --prod --token="$ VERCEL_TOKEN"
102+ vercel deploy --prod --prebuilt --token="$ VERCEL_TOKEN"
94103 else
95- vercel pull --yes --environment=preview --token=${{ secrets. VERCEL_TOKEN }}
96- vercel build --token=${{ secrets. VERCEL_TOKEN }}
97- vercel deploy --prebuilt --token=${{ secrets. VERCEL_TOKEN }}
104+ vercel pull --yes --environment=preview --token="$ VERCEL_TOKEN"
105+ vercel build --token="$ VERCEL_TOKEN"
106+ vercel deploy --prebuilt --token="$ VERCEL_TOKEN"
98107 fi
0 commit comments