-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 2.03 KB
/
fetch.yml
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
54
55
56
name: fetch new files and re-index
on:
schedule:
- cron: '30 5,12,17 * * *'
push:
jobs:
deploy:
runs-on: ubuntu-latest
env:
EXPEDIENTES: 182908/2020-0 182908/2020-1 9480/2019-0 182908/2020-4
EXPEDIENTES_JSON: '[{"id":"Sistema de Reconocimiento Facial","file":"182908-2020-0"},{"id":"Recusación","file":"182908-2020-1"},{"id":"AIP","file":"9480-2019-0"},{"id":"Recusación 2","file":"182908-2020-4"}]'
CNAME: srfp-expediente.odia.legal
COMMIT_AUTHOR: ODIA <[email protected]>
READ_IMAGES: true
steps:
- name: Checkout main repo
uses: actions/checkout@v2
- name: Checkout pages repo
uses: actions/checkout@v2
with:
ref: 'gh-pages'
path: 'build'
- name: Checkout PDFs repo
uses: actions/checkout@v2
with:
repository: 'odia/srfp-documentos.github.io'
path: 'pdfs'
- name: Build the Docker image
run: docker build . --file Dockerfile --tag juscaba
- name: Run the container
run: docker run -v $(pwd):/tmp/juscaba juscaba ./run.sh $EXPEDIENTES
- name: Create expedientes.json
run: echo "${EXPEDIENTES_JSON}" > build/data/expedientes.json
- name: Create CNAME
run: echo "${CNAME}" > build/CNAME
- name: Deploy main
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
- name: Deploy non main
if: github.ref != 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_branch: ${{ github.ref }}-pages
- name: Deploy pdfs
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.SRFP_EXPEDIENTE_KEY }}
external_repository: odia/srfp-documentos.github.io
publish_branch: gh-pages
publish_dir: ./pdfs