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: Continuous Integration and Deployment | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- beta | |
jobs: | |
Integration_And_Deployment: | |
runs-on: ubuntu-latest | |
env: | |
BASE_REF: ${{ github.event.pull_request.base.ref != '' && github.event.pull_request.base.ref || 'master' }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "npm" | |
- name: Setup Nx | |
uses: nrwl/nx-set-shas@v3 | |
with: | |
main-branch-name: "master" | |
- name: Fetch base branch | |
run: git fetch origin ${{ env.BASE_REF }}:${{ env.BASE_REF }} | |
- name: Install Dependencies | |
run: npm ci | |
- name: Format packages | |
run: npx nx format:check | |
- name: Lint packages | |
run: npx nx affected --base=${BASE_REF} --head=HEAD -t lint | |
- name: Build Packages | |
run: npx nx affected --base=${BASE_REF} --head=HEAD -t build | |
- name: Test Packages | |
run: npx nx affected --base=${BASE_REF} --head=HEAD -t test --configuration=ci | |
- name: Deploy Prod | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
env: | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
run: npx nx run-many -t deploy:prod | |
- name: Deploy Beta | |
if: github.ref == 'refs/heads/beta' && github.event_name == 'push' | |
env: | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
run: npx nx run-many -t deploy:beta |