diff --git a/.github/workflows/preview-common.yaml b/.github/workflows/preview-common.yaml index 69f44fe..7f9dfc1 100644 --- a/.github/workflows/preview-common.yaml +++ b/.github/workflows/preview-common.yaml @@ -9,9 +9,10 @@ on: vercel_scope: required: true type: string - vercel_token: + + secrets: + VERCEL_TOKEN: required: true - type: string jobs: shared-steps: @@ -29,13 +30,13 @@ jobs: run: corepack install - name: Link Project to Vercel - run: yarn dlx -q vercel link --project=${{ inputs.vercel_project_name }} --scope=${{ inputs.vercel_scope }} --yes --token=${{ inputs.vercel_token }} + run: yarn dlx -q vercel link --project=${{ inputs.vercel_project_name }} --scope=${{ inputs.vercel_scope }} --yes --token=${{ secrets.VERCEL_TOKEN }} - name: Pull Vercel Environment Information - run: yarn dlx -q vercel pull --yes --environment=preview --token=${{ inputs.vercel_token }} + run: yarn dlx -q vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - name: Build Project Artifacts - run: yarn dlx -q vercel build --token=${{ inputs.vercel_token }} + run: yarn dlx -q vercel build --token=${{ secrets.VERCEL_TOKEN }} - name: Deploy Project Artifacts to Vercel - run: yarn dlx -q vercel deploy --prebuilt --token=${{ inputs.vercel_token }} + run: yarn dlx -q vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 2ddc3c4..26ff543 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -5,17 +5,29 @@ on: branches: - dev + workflow_call: + inputs: + VERCEL_PROJECT_DEFAULT: + required: true + type: string + VERCEL_PROJECT_UPGRADE: + required: true + type: string + VERCEL_SCOPE: + required: true + type: string + jobs: default-example: uses: ./.github/workflows/preview-common.yaml + secrets: inherit with: - vercel_project_name: ${{ secrets.VERCEL_NAME_EXAMPLE_DEFAULT }} - vercel_scope: ${{ secrets.VERCEL_SCOPE }} - vercel_token: ${{ secrets.VERCEL_TOKEN }} + vercel_project_name: ${{ inputs.VERCEL_PROJECT_DEFAULT }} + vercel_scope: ${{ inputs.VERCEL_SCOPE }} upgrade-example: uses: ./.github/workflows/preview-common.yaml + secrets: inherit with: - vercel_token: ${{ secrets.VERCEL_TOKEN }} - vercel_project_name: ${{ secrets.VERCEL_NAME_EXAMPLE_UPGRADE }} - vercel_scope: ${{ secrets.VERCEL_SCOPE }} + vercel_project_name: ${{ inputs.VERCEL_PROJECT_UPGRADE }} + vercel_scope: ${{ inputs.VERCEL_SCOPE }}