-
Notifications
You must be signed in to change notification settings - Fork 49
75 lines (61 loc) · 2.09 KB
/
ci.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: gha-runner-x64
steps:
- uses: actions/checkout@v4
- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: yarn@4.1.1
run: |
corepack enable && corepack prepare yarn@4.1.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Get yarn cache
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-yarn-docs-
- name: Install dependencies
uses: borales/actions-yarn@v5
with:
cmd: install --immutable
# - name: Save yarn cache
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# uses: actions/cache/save@v4
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }}
- name: Build
uses: borales/actions-yarn@v5
with:
cmd: build
env:
NODE_OPTIONS: --openssl-legacy-provider
- name: Lint
uses: borales/actions-yarn@v5
with:
cmd: lint
env:
NODE_OPTIONS: --openssl-legacy-provider
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Docker Build
run: |
gcloud info
gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }}
docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push