-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (48 loc) · 1.54 KB
/
docker_cron.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Run the cron job in docker container
name: docker_cron
on:
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *' # daily
jobs:
salvage_pipeline:
name: salvage pipeline
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install containers
run: |
docker pull dapperstats/accessor
docker pull dapperstats/salvage
- name: start up and name containers
run: |
docker run --name acc --restart=always -i dapperstats/accessor
docker run --name salv --restart=always -id dapperstats/salvage
- name: copy data files and scripts
run: |
docker cp acc:/data .
docker cp data salv:/
docker cp acc:/scripts .
docker cp scripts salv:/
docker cp site salv:/
- name: run R salvage script in the container
run: |
docker exec -i salv R -e "source('scripts/salvage_script.R')"
- name: copy out the site and list contents
run: |
docker cp salv:/site .
ls site
- name: update the github repo with the built site for cron
if: ${{ github.event_name == 'schedule'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bash scripts/update_github.bash
- name: don't update the github repo with the built site for pr
if: ${{ github.event_name == 'pull_request'}}
run: |
echo "Repo not updated for PR only"