-
-
Save guilhermedinardi/cd4e9006c2d098a095cc173aa1c6bcaa to your computer and use it in GitHub Desktop.
deploy
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
//primeiro pipeline | |
name: Build | |
on: | |
push: | |
branches: [$default-branch] | |
workflow_dispatch: | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
jobs: | |
build: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: yarn | |
- name: Run Prettier | |
run: | | |
yarn check | |
yarn format | |
- name: Run Lint | |
run: | | |
yarn lint | |
yarn lint --fix | |
// segundo pipeline | |
name: Homolog | |
on: | |
pull_request: | |
branches: [homolog] | |
types: [opened, synchronize] | |
workflow_dispatch: | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
jobs: | |
homolog: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Vercel Pull Homolog | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_HOMOLOG }} | |
- name: Vercel Build Homolog | |
run: vercel build --token=${{ secrets.VERCEL_HOMOLOG }} | |
- name: Vercel Deploy Homolog | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_HOMOLOG }} | |
// terceiro pipeline | |
name: Deploy | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
workflow_dispatch: | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [homolog] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
- run: yarn install --immutable | |
- name: Vercel Pull Prod | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_PROD }} | |
- name: Vercel Build Prod | |
run: vercel build --prod --token=${{ secrets.VERCEL_PROD }} | |
- name: Vercel Deploy Prod | |
run: vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_PROD }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment