Skip to content

Cron job purge data #73

Cron job purge data

Cron job purge data #73

name: Cron job purge data
on:
workflow_dispatch:
schedule:
- cron: "0 14 1 * *"
jobs:
purge_file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Setup node 18
uses: actions/setup-node@v1
with:
node-version: 18.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Node.js modules
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-
- name: Install dependencies
run: yarn
- name: Run purge
run: yarn purge
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "mazipan"
git config --global --add safe.directory /github/workspace
git add -A
git commit -m "🔥 CHORE: purge all data"
- name: GitHub Push
uses: ad-m/[email protected]
with:
force: true
directory: "."
github_token: ${{ secrets.GIT_TOKEN }}