-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.42 KB
/
push-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: push-main
on:
push:
branches:
- main
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_ENCRYPTION_KEY: ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }}
jobs:
push-main-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: main
error-on-no-successful-workflow: true
- name: Setup node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install packages
run: npm ci
- name: Check formatting
run: npx nx format:check --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
- name: Lint affected
run: npx nx affected --target=lint --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
- name: Build affected
run: npx nx affected --target=build --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
- name: Test affected
run: npx nx affected --target=test --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
- name: Publish affected
run: npx nx affected --target=publish --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}