-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (45 loc) · 1.29 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
name: Build script and update dist on script sources update on master
on:
push:
branches:
- master
paths:
- 'action.sh'
- 'action.yml'
- 'index.js'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Pull source code
uses: actions/checkout@v2
with:
path: './'
- name: Clean npm cache directory
run: npm cache clear --force
- name: Detect npm cache location
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Set up workflow caching of npm cache
uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-cache-
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Setup git creds
uses: oleksiyrudenko/gha-git-credentials@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit update and tag with rc (forcedly)
run: |
git commit -m "Update dist/*" -a
git tag -f rc
- name: Publish changes
run: |
git push
git push -f origin rc