generated from hankei6km/my-starter-gas-lib-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.83 KB
/
push.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
name: Push to GAS project
on:
push:
branches:
- '**'
- '!main'
tags:
- '!v*'
jobs:
push-to-gas:
runs-on: ubuntu-latest
environment: dev
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
# https://docs.github.com/ja/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-push-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-push-${{ env.cache-name }}-
${{ runner.os }}-push-
- name: Install clasp
# バージョン固定した方がよいか ?
run: npm install -g @google/clasp
- name: Install modules
run: npm ci
- name: Run tests
run: npm run test:build
- name: Build files to push gas project
# テスト用にビルドされたものが存在するが再度ビルドする.
run: npm run build
- name: Setup files for clasp
run: npm run setup:clasp
env:
GAS_SCRIPT_ID: ${{ secrets.GAS_SCRIPT_ID }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
SCOPE: ${{ secrets.SCOPE }}
ID_TOKEN: ${{ secrets.ID_TOKEN }}
EXPIRY_DATE: ${{ secrets.EXPIRY_DATE }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
- name: Push source files to gas project
run: npm run push
# 念のため実行.
- name: Cleanup files for clasp
run: npm run cleanup:clasp