Update README.md #11
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 services | |
on: | |
push: | |
branches: | |
- 'main' | |
concurrency: | |
group: deployments | |
cancel-in-progress: false | |
jobs: | |
get_affected_apps: | |
name: Get affected apps | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # NX needs the entire repo history to run affected commands | |
- name: Set NX commit SHAs for affected commands | |
uses: nrwl/nx-set-shas@v2 # derive appropriate SHAs for base and head for `nx affected` commands | |
# Only install nx affected command requirements, no need for a full dependency install | |
- name: Install requirements for nx | |
run: | | |
NX_REPO_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@nrwl/workspace'])") | |
TS_REPO_VERSION=$(node -e "console.log(require('./package.json').devDependencies['typescript'])") | |
yarn add -D @nrwl/workspace@$NX_REPO_VERSION --prefer-offline | |
yarn add -D typescript@$TS_VERSION --prefer-offline | |
./node_modules/.bin/nx affected:apps --plain | |
- name: Set affected outputs | |
id: set_affected_outputs | |
shell: bash | |
run: ./tools/scripts/getAffectedApps.sh | |
- name: Verify outputs | |
run: | | |
echo "Will deploy client? ${{ steps.set_affected_outputs.outputs.client_affected == 'true' && 'yes' || 'no' }}" | |
echo "Will deploy server? ${{ steps.set_affected_outputs.outputs.server_affected == 'true' && 'yes' || 'no' }}" | |
echo "Will deploy workers? ${{ steps.set_affected_outputs.outputs.workers_affected == 'true' && 'yes' || 'no' }}" | |
outputs: | |
should_deploy_client: ${{ steps.set_affected_outputs.outputs.client_affected }} | |
should_deploy_server: ${{ steps.set_affected_outputs.outputs.server_affected }} | |
should_deploy_workers: ${{ steps.set_affected_outputs.outputs.workers_affected }} | |
deploy_production: | |
name: Deploy production services | |
needs: [get_affected_apps] | |
uses: ./.github/workflows/template.deploy-services.yml | |
with: | |
deploy_env: production | |
deploy_shared_stack: true | |
deploy_vercel_client: ${{ needs.get_affected_apps.outputs.should_deploy_client == 'true' }} | |
deploy_server_stack: ${{ needs.get_affected_apps.outputs.should_deploy_server == 'true' }} | |
deploy_workers_stack: ${{ needs.get_affected_apps.outputs.should_deploy_workers == 'true' }} | |
secrets: inherit |