Merge pull request #2 from askdialog/fix-brave-tracking #14
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
on: | |
push: | |
branches: | |
- main | |
name: π Deploy main | |
concurrency: deploy_main | |
permissions: | |
id-token: write # this is required for AWS https://github.com/aws-actions/configure-aws-credentials#usage | |
contents: read # this is required for Nx https://github.com/nrwl/nx-set-shas#permissions-in-v2 | |
actions: read # this is required for Nx https://github.com/nrwl/nx-set-shas#permissions-in-v2 | |
env: | |
CI: true | |
AWS_REGION: eu-west-1 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-and-test: | |
name: π Build Project, π§ͺ Run Tests & π Deploy | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
# We need to fetch all branches and commits so that Nx affected has a base to compare against. | |
fetch-depth: 0 | |
- uses: nrwl/nx-set-shas@v3 | |
- uses: pnpm/[email protected] | |
- name: Setup Node.js | |
id: setup-node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: πΎ Cache Nx cache | |
id: package-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
nx-cache | |
# Cache will be updated at every run: https://github.com/actions/cache/blob/main/workarounds.md#update-a-cache | |
key: ${{ runner.os }}-nx-cache-${{ steps.setup-node.outputs.node-version }}-${{ github.run_id }} | |
restore-keys: | | |
${{ runner.os }}-nx-cache-${{ steps.setup-node.outputs.node-version }}- | |
${{ runner.os }}-nx-cache- | |
- name: 'π Package' | |
run: pnpm nx affected --target=package --parallel=2 | |
- name: 'π§ͺ Run tests' | |
run: pnpm nx affected --targets=test-linter,test-type,test-unit,test-circular --parallel=2 |