Skip to content

Commit

Permalink
exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Sep 14, 2024
1 parent 271b31f commit ff15614
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/actions/vercel/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,47 +49,47 @@ runs:
echo "exit_code=$?" >> $GITHUB_OUTPUT
- name: Install Vercel CLI
if: steps.ignore-build.outputs.exit_code || inputs.force == 'true'
if: steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true'
shell: bash
run: pnpm install --global vercel@latest

- name: Pull Vercel Environment
if: steps.ignore-build.outputs.exit_code || inputs.force == 'true'
if: steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true'
shell: bash
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.token }}

- name: Build Vercel Preview
shell: bash
if: (steps.ignore-build.outputs.exit_code || inputs.force == 'true') && inputs.environment == 'preview'
if: (steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true') && inputs.environment == 'preview'
run: vercel build --yes --token=${{ inputs.token }}

- name: Deploy Vercel Preview
shell: bash
if: (steps.ignore-build.outputs.exit_code || inputs.force == 'true') && inputs.environment == 'preview' && inputs.skip_deploy == 'false'
if: (steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true') && inputs.environment == 'preview' && inputs.skip_deploy == 'false'
id: deploy-preview
run: |
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --token=${{ inputs.token }} --archive=tgz)"
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
- name: Build Vercel Production
shell: bash
if: (steps.ignore-build.outputs.exit_code || inputs.force == 'true') && inputs.environment == 'production'
if: (steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true') && inputs.environment == 'production'
run: vercel build --yes --prod --token=${{ inputs.token }}

- name: Deploy Vercel Production
shell: bash
if: (steps.ignore-build.outputs.exit_code || inputs.force == 'true') && inputs.environment == 'production' && inputs.skip_deploy == 'false'
if: (steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true') && inputs.environment == 'production' && inputs.skip_deploy == 'false'
id: deploy-production
run: |
DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --prod --skip-domain --token=${{ inputs.token }} --archive=tgz)"
echo "deployment_url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
- name: Wait for Deployment
shell: bash
if: (steps.ignore-build.outputs.exit_code || inputs.force == 'true') && inputs.skip_deploy == 'false'
if: (steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true') && inputs.skip_deploy == 'false'
run: vercel inspect ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }} --wait

- name: Promote Vercel Production
shell: bash
if: (steps.ignore-build.outputs.exit_code || inputs.force == 'true') && inputs.environment == 'production' && inputs.skip_deploy == 'false' && inputs.promote == 'true'
if: (steps.ignore-build.outputs.exit_code != '0' || inputs.force == 'true') && inputs.environment == 'production' && inputs.skip_deploy == 'false' && inputs.promote == 'true'
run: vercel promote ${{ steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }}

0 comments on commit ff15614

Please sign in to comment.