-
-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (45 loc) · 1.66 KB
/
deploy.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy Apps Script
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'latest' # Specifies the latest version of Node.js
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm # Location of the Node.js cache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install clasp globally
run: npm install -g @google/clasp
- name: Insert config to main folder
run: echo $CLASP_SETTINGS_JSON > .clasprc.json & echo $CLASP_JSON > .clasp.json
env:
CLASP_SETTINGS_JSON: ${{ secrets.clasprc_json }}
CLASP_JSON: ${{ secrets.clasp_json }}
- name: Clasp push
run: clasp -A ./.clasprc.json -P ./.clasp.json push -f
- name: Clasp deploy
run: clasp -A ./.clasprc.json -P ./.clasp.json deploy -i ${{ secrets.DEPLOY_ID }} -d "${{ github.event.head_commit.message }}"
# - name: Deploy to Apps Script
# uses: daikikatsuragawa/clasp-action@v1.1.0
# with:
# accessToken: ${{ secrets.ACCESS_TOKEN }}
# idToken: ${{ secrets.ID_TOKEN }}
# refreshToken: ${{ secrets.REFRESH_TOKEN }}
# clientId: ${{ secrets.CLIENT_ID }}
# clientSecret: ${{ secrets.CLIENT_SECRET }}
# scriptId: ${{ secrets.SCRIPT_ID }}
# deployId: ${{ secrets.DEPLOY_ID }}
# rootDir: "./"
# command: 'deploy'