This repository has been archived by the owner on Jul 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 3.88 KB
/
main.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
57
58
59
60
61
62
name: main
on:
workflow_dispatch:
schedule:
- cron: "0 */4 * * *"
push:
branches-ignore:
- main
jobs:
update:
permissions:
contents: write
runs-on: ubuntu-20.04
name: update-mirror
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y \
curl python3 python3-pip
pip3 install --user cbor2==5.4.1 tabulate==0.8.9
- name: Download
run: |
mkdir -p dir/prod
curl --fail "https://dgc-trust.qr.gv.at/trustlist" -o dir/prod/trustlist || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/prod/trustlist -o dir/prod/trustlist
curl --fail "https://dgc-trust.qr.gv.at/trustlistsig" -o dir/prod/trustlistsig || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/prod/trustlistsig -o dir/prod/trustlistsig
curl --fail "https://dgc-trust.qr.gv.at/rules" -o dir/prod/rules || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/prod/rules -o dir/prod/rules
curl --fail "https://dgc-trust.qr.gv.at/rulessig" -o dir/prod/rulessig || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/prod/rulessig -o dir/prod/rulessig
curl --fail "https://dgc-trust.qr.gv.at/valuesets" -o dir/prod/valuesets || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/prod/valuesets -o dir/prod/valuesets
curl --fail "https://dgc-trust.qr.gv.at/valuesetssig" -o dir/prod/valuesetssig || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/prod/valuesetssig -o dir/prod/valuesetssig
mkdir -p dir/prod.json
python3 -m cbor2.tool --pretty --sort-keys dir/prod/trustlist -o dir/prod.json/trustlist.json
python3 -m cbor2.tool --pretty --sort-keys dir/prod/rules -o dir/prod.json/rules.json
python3 -m cbor2.tool --pretty --sort-keys dir/prod/valuesets -o dir/prod.json/valuesets.json
python3 rules.py dir/prod.json/rules.json > dir/prod.json/rules-at.md
mkdir -p dir/test
curl --fail "https://dgc-trusttest.qr.gv.at/trustlist" -o dir/test/trustlist || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/test/trustlist -o dir/test/trustlist
curl --fail "https://dgc-trusttest.qr.gv.at/trustlistsig" -o dir/test/trustlistsig || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/test/trustlistsig -o dir/test/trustlistsig
curl --fail "https://dgc-trusttest.qr.gv.at/rules" -o dir/test/rules || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/test/rules -o dir/test/rules
curl --fail "https://dgc-trusttest.qr.gv.at/rulessig" -o dir/test/rulessig || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/test/rulessig -o dir/test/rulessig
curl --fail "https://dgc-trusttest.qr.gv.at/valuesets" -o dir/test/valuesets || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/test/valuesets -o dir/test/valuesets
curl --fail "https://dgc-trusttest.qr.gv.at/valuesetssig" -o dir/test/valuesetssig || curl --fail https://digital-blueprint.github.io/dgc-trust-mirror/test/valuesetssig -o dir/test/valuesetssig
mkdir -p dir/test.json
python3 -m cbor2.tool --pretty --sort-keys dir/test/trustlist -o dir/test.json/trustlist.json
python3 -m cbor2.tool --pretty --sort-keys dir/test/rules -o dir/test.json/rules.json
python3 -m cbor2.tool --pretty --sort-keys dir/test/valuesets -o dir/test.json/valuesets.json
python3 rules.py dir/test.json/rules.json > dir/test.json/rules-at.md
cp README.md ./dir
cp index.html ./dir
cp .gitattributes ./dir
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dir
publish_branch: main