16 - Working with Environments #6
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: 16 - Working with Environments | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy-staging: | |
runs-on: ubuntu-latest | |
environment: staging | |
env: | |
my-env-value: ${{ vars.MY_ENV_VALUE || 'default value' }} | |
steps: | |
- name: Echo vars | |
run: | | |
echo "Deploying to staging" | |
e2e-tests: | |
runs-on: ubuntu-latest | |
needs: deploy-staging | |
steps: | |
- name: E2E tests | |
run: echo "Running E2e" | |
deploy-prod-frontend: | |
runs-on: ubuntu-latest | |
needs: e2e-tests | |
environment: prod | |
env: | |
my-env-value: ${{ vars.MY_ENV_VALUE || 'default value' }} | |
steps: | |
- name: Echo vars | |
run: | | |
echo "Deploying prod frontend" | |
deploy-prod-backend1: | |
runs-on: ubuntu-latest | |
needs: e2e-tests | |
environment: prod | |
env: | |
my-env-value: ${{ vars.MY_ENV_VALUE || 'default value' }} | |
steps: | |
- name: Echo vars | |
run: | | |
echo "Deploying prod backend 1" | |
deploy-prod-backend2: | |
runs-on: ubuntu-latest | |
needs: e2e-tests | |
environment: prod | |
env: | |
my-env-value: ${{ vars.MY_ENV_VALUE || 'default value' }} | |
steps: | |
- name: Echo vars | |
run: | | |
echo "Deploying prod backend 2" |