Skip to content

Commit 9a74f69

Browse files
committed
Add workflow release pipeline
1 parent 8c46099 commit 9a74f69

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Continuous Deployment
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
checks:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout default branch
13+
uses: actions/checkout@v2
14+
15+
- name: Use Node.js 16
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: 16
19+
20+
- name: Cache dependencies
21+
id: npm_cache
22+
uses: actions/cache@v2
23+
with:
24+
path: '**/node_modules'
25+
key: node16-${{ hashFiles('package-lock.json') }}
26+
27+
- name: Install dependencies
28+
if: steps.npm_cache.outputs.cache-hit != 'true'
29+
run: npm ci
30+
31+
- name: Lint and fix code
32+
run: npm run lint
33+
34+
- name: Typecheck
35+
run: npm run typecheck
36+
37+
publish:
38+
runs-on: ubuntu-latest
39+
40+
needs: checks
41+
42+
permissions:
43+
packages: write
44+
contents: read
45+
46+
steps:
47+
- name: Checkout default branch
48+
uses: actions/checkout@v2
49+
50+
- name: Use Node.js 16 (npm repository)
51+
uses: actions/setup-node@v2
52+
with:
53+
node-version: 16
54+
registry-url: 'https://registry.npmjs.org'
55+
56+
- name: Cache dependencies
57+
id: npm_cache
58+
uses: actions/cache@v2
59+
with:
60+
path: '**/node_modules'
61+
key: node16-${{ hashFiles('package-lock.json') }}
62+
63+
- name: Install dependencies
64+
if: steps.npm_cache.outputs.cache-hit != 'true'
65+
run: npm ci
66+
67+
- name: Build Frontify Authenticator
68+
run: npm run build
69+
70+
- name: Publish to npm
71+
run: npm publish --access public
72+
env:
73+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
74+
75+
- name: Use Node.js 16 (GitHub repository)
76+
uses: actions/setup-node@v2
77+
with:
78+
registry-url: 'https://npm.pkg.github.com'
79+
node-version: 16
80+
81+
- name: Publish to GitHub Packages
82+
run: npm publish --access public
83+
env:
84+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
env:
9+
CI: true
10+
11+
jobs:
12+
continuous-integration:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout current commit
17+
uses: actions/checkout@v2
18+
19+
- name: Use Node.js 16
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: '16'
23+
24+
- name: Cache NPM dependencies
25+
id: npm_cache
26+
uses: actions/cache@v2
27+
with:
28+
path: '**/node_modules'
29+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
30+
31+
- name: Install NPM dependencies
32+
if: steps.npm_cache.outputs.cache-hit != 'true'
33+
run: npm ci
34+
35+
- name: Typecheck files
36+
run: npm run typecheck
37+
38+
- name: Lint files
39+
run: npm run lint

0 commit comments

Comments
 (0)