ci: rename environments of jobs and add environment for deploy produc… #38
Workflow file for this run
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
name: Deploy non-production | |
on: | |
push: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
deploy-preview: | |
name: Deploy preview | |
runs-on: ubuntu-latest | |
if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release-please') }} | |
environment: | |
name: preview | |
url: ${{ steps.deploy.outputs.url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check changed files | |
id: check-changed-files | |
uses: ./.github/workflows/actions/get-changed-files | |
- name: Deploy to vercel | |
if: ${{ steps.check-changed-files.outputs.any_changed == 'true' }} | |
id: deploy-preview | |
uses: ./.github/workflows/actions/deploy | |
with: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
TARGET_ENVIRONMENT: preview | |
deploy-staging: | |
name: Deploy staging | |
runs-on: ubuntu-latest | |
environment: | |
name: staging | |
url: ${{ steps.deploy.outputs.url }} | |
if: ${{ github.ref_name == 'main' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Deploy | |
id: deploy-staging | |
uses: ./.github/workflows/actions/deploy | |
with: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
TARGET_ENVIRONMENT: staging |