generated from melange-re/melange-esy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (53 loc) · 1.85 KB
/
update-esy-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
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
update-esy-dependencies:
strategy:
matrix:
system: [ubuntu-latest]
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: current
- name: npm install
run: npm install
- name: Remove lockfile
run: rm -rf esy.lock
# Separating the esy steps provides more fine-grained insight when
# debugging failed jobs
- name: Update esy dependencies (esy install)
run: npx esy install
- name: Check if any dependencies were updated
id: check-for-updates
run: test -n "$(git status --porcelain)"
continue-on-error: true
- name: Build esy dependencies
if: steps.check-for-updates.outcome == 'success'
run: npx esy build-dependencies --release
- name: Build project
if: steps.check-for-updates.outcome == 'success'
run: npx esy build --release
- name: Bundle JS app
if: steps.check-for-updates.outcome == 'success'
run: npm run bundle
- name: Create pull request to update dependencies
if: steps.check-for-updates.outcome == 'success'
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update esy dependencies
branch: update-esy-dependencies
delete-branch: true
title: Update esy dependencies
- name: Cache dependencies
if: steps.check-for-updates.outcome == 'success'
uses: actions/cache@v3
with:
# The entire ~/.esy directory has to be cached because esy's
# import/export commands don't import/export the Melange JS runtime
# files
path: ~/.esy
key: ${{ matrix.system }}-esy-${{ hashFiles('esy.lock/index.json') }}