-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 2.01 KB
/
create-zip.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
58
59
60
61
62
name: Create zip file of build on every push
# Controls when the action will run.
on:
push:
branches:
- master
schedule:
# Run once every 2 months to ensure there's always a zip file available (build artifacts are deleted in 90 days)
- cron: '42 0 1 */2 *'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "create-zip"
create-zip:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Send greeting
run: echo "Hello world!"
- uses: actions/checkout@v2
- name: Cache node_modules
uses: actions/cache@v2.1.5
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: node_modules
# An explicit key for restoring and saving the cache
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
node-version: ">=10.15.0" # TODO: fix
- name: Install Dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run build
- name: Remove all old artifacts
# You may pin to the exact commit or the version.
# uses: c-hive/gha-remove-artifacts@24dc23384a1fa6a058b79c73727ae0cb2200ca4c
uses: c-hive/gha-remove-artifacts@v1.2.0
with:
# Artifacts older than this will be deleted (e.g. "2 months", "1 day"). Parsed by moment.
age: "1 minute"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.2.3
with:
# Artifact name
name: build
# A file, directory or wildcard pattern that describes what to upload
path: dist
retention-days: 90