generated from ecomplus/storefront-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (46 loc) · 1.58 KB
/
update-dependencies.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
55
56
57
name: Update dependencies
on:
schedule:
- cron: '30 14,16,17,19 * * MON-FRI'
jobs:
update-dependencies:
name: Update dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Update package dependencies
run: npm update --only=production
- name: Config Git user
run: |
git config --local user.email '[email protected]'
git config --local user.name 'GitHub Action'
- name: Check if template was updated
run: |
git diff package-lock.json | grep 'ecomplus/storefront-template' \
&& echo "::set-output name=updated::1" \
|| echo "::set-output name=updated::0"
id: check_template
- name: Commit files if changed
run: |
git add package-lock.json content
git diff-index --quiet HEAD || git commit -m '[skip ci] chore(deps): update pkg dependencies'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Run build with new template
if: steps.check_template.outputs.updated == '1'
run: npm run build
- name: Deploy to branch dist
if: steps.check_template.outputs.updated == '1'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: dist
FOLDER: dist