CI #488
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |