From 57f2437a80517c5b0bba854874848a7f73f025b9 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Mon, 15 May 2023 10:28:27 -0400 Subject: [PATCH] ci: create sandbox-refresh.yml workflow --- .github/workflows/sandbox-refresh.yml | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/sandbox-refresh.yml diff --git a/.github/workflows/sandbox-refresh.yml b/.github/workflows/sandbox-refresh.yml new file mode 100644 index 000000000..4d27b9c74 --- /dev/null +++ b/.github/workflows/sandbox-refresh.yml @@ -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