Skip to content

update script

update script #17

name: Make scheduled CTFd backup
on:
schedule:
- cron: '0 0 * * *'
jobs:
deploy:

Check failure on line 8 in .github/workflows/ctfd_cron_backup.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ctfd_cron_backup.yml

Invalid workflow file

You have an error in your yaml syntax on line 8
runs-on: ubuntu-22.04
env:
BACKUP_PATH: /tmp/ctfd_backup.zip
CTFD_URL: https://ctf.heroctf.fr
- name: Install curl
shell: bash
run: |
apt-get update && apt-get install -y curl
- name: Do backup
shell: bash
run: |
curl "${{ env.CTFD_URL }}/admin/export" \
-b "session=${{ secrets.CTFD_COOKIE_SESSION }}" \
-o "${{ env.BACKUP_PATH }}"
- name: Obtain current date
shell: bash
run: echo "BACKUP_TIME=$(date '+%Y-%m-%d_%H-%M')" >> $GITHUB_ENV
- name: Upload backup
uses: actions/upload-artifact@v2
with:
name: "ctfd_backup_${BACKUP_TIME}.zip"
path: "${{ env.BACKUP_PATH }}"
retention-days: 7