-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (66 loc) · 2.17 KB
/
ci.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
shared:
uses: pantos-io/ci-workflows/.github/workflows/python-ci.yml@v1
secrets: inherit
docker-build:
name: Build Docker images
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v2
with:
disable-sudo: false
egress-policy: audit
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-v1.0-service-node-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-v1.0-service-node-
- name: Build and load
run: |
docker buildx bake \
--set "*.cache-from=type=local,src=/tmp/.buildx-cache" \
--set "*.cache-to=type=local,dest=/tmp/.buildx-cache-new" \
--set "*.platform=linux/amd64" \
--builder ${{ steps.buildx.outputs.name }} \
-f docker-compose.yml \
--load
- name: Create local keystore
run: |
echo "1234" >> password.keystore
mkdir keystore_folder
docker run --rm -v=.:/local ethereum/client-go account new --keystore /local/keystore_folder --password /local/password.keystore
sudo chmod -R 777 keystore_folder
mv keystore_folder/UTC* ./keystore
- name: Create local signer_key
run: |
echo "1234" >> password.key
python3 -m venv .venv
source .venv/bin/activate
pip3 install pycryptodome==3.18.0
chmod +x scripts/generate-signer-key.py
cat password.key | ./scripts/generate-signer-key.py
mv signer-key*.pem signer_key.pem
# - name: Test image
# run: |
# docker compose up -d
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build:
needs: [shared]
uses: ./.github/workflows/build.yml