initial commit
This commit is contained in:
40
.github/workflows/backup.yaml
vendored
Normal file
40
.github/workflows/backup.yaml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
name: Run backup
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 * * * 1-5'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
num:
|
||||
description: 'Number of commit to backup (0: unlimited)'
|
||||
required: true
|
||||
default: '10'
|
||||
|
||||
jobs:
|
||||
backup-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set num default value
|
||||
run: |
|
||||
NUM=${{ github.event.inputs.num }}
|
||||
echo "NUM=${NUM:-10}" >> $GITHUB_ENV
|
||||
|
||||
- name: Run backup script
|
||||
run: |
|
||||
/bin/bash scripts/backup.sh -r https://github.com/descartes-underwriting/devops-technical-test-data.git -b 01-01-2022-test -n ${{ env.NUM }}
|
||||
/bin/bash scripts/backup.sh -r https://github.com/descartes-underwriting/devops-technical-test-data.git -b main -d $(pwd)/data_main -n ${{ env.NUM }}
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add data data_main
|
||||
git commit -m "Auto-update from backup job" || exit 0
|
||||
git push
|
||||
|
17
.github/workflows/tests.yaml
vendored
Normal file
17
.github/workflows/tests.yaml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
/bin/bash scripts/tests.sh
|
Reference in New Issue
Block a user