-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (49 loc) · 1.46 KB
/
ci.yaml
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
name: CI
"on":
push:
workflow_dispatch:
schedule:
- cron: "0 0,12 * * *"
jobs:
build:
name: Build and test the action
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v3
# http://man7.org/linux/man-pages/man1/date.1.html
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+date-%Y-%m-%d-time-%H-%M-%S")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v3
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json', 'package.json') }}-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json', 'package.json') }}-
- name: Install packages & Build the action
run: npm ci
# -------- THIS ACTION --------
- name: Purge caches
uses: ./.
with:
debug: true
created: true
accessed: true
# 3 days
max-age: 259200
# -------- THIS ACTION --------
- name: Commit & Push changes
if: github.event_name == 'push'
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git rebase origin/master
git add dist
git commit -m "action: build the action" || echo ""
git push