ci: create sandbox-refresh.yml workflow

This commit is contained in:
Nicolas Giard 2023-05-15 10:28:27 -04:00 committed by GitHub
parent 52f34717dd
commit 57f2437a80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

35
.github/workflows/sandbox-refresh.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Sandbox Refresh
on:
# Run every night
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
jobs:
main:
name: Refresh DBs
runs-on: [self-hosted, dev-server]
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Refresh DBs
env:
DEBIAN_FRONTEND: noninteractive
run: |
echo "Install Deploy to Container CLI dependencies..."
cd dev/deploy-to-container
npm ci
cd ../..
echo "Start Refresh..."
node ./dev/deploy-to-container/refresh.js
- name: Cleanup old docker resources
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker image prune -a -f