Skip to content

Commit b8dc1a4

Browse files
committed
feat(ci): add a new job to test the keys generation
1 parent c57805f commit b8dc1a4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/test-keygen.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test keys generation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
generate-keys:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Log in to registry
18+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
19+
20+
- name: Download Docker cache image (if available)
21+
run: docker pull ghcr.io/$GITHUB_REPOSITORY/build-cache || true
22+
23+
- name: Build the Docker image
24+
run: |
25+
git fetch --prune --unshallow --tags
26+
docker build . -t alephim/pyaleph-node:${GITHUB_REF##*/} -f deployment/docker-build/pyaleph.dockerfile --cache-from=ghcr.io/$GITHUB_REPOSITORY/build-cache
27+
28+
- name: Tag the image
29+
run: |
30+
docker tag alephim/pyaleph-node:${GITHUB_REF##*/} ghcr.io/$GITHUB_REPOSITORY/build-cache
31+
32+
- name: Generate keys
33+
run: |
34+
mkdir keys
35+
docker run --rm --user root --entrypoint "" -v $(pwd)/keys:/opt/pyaleph/keys alephim/pyaleph-node:${GITHUB_REF##*/} chown aleph:aleph /opt/pyaleph/keys
36+
docker run --rm --entrypoint "" -v $(pwd)/keys:/opt/pyaleph/keys alephim/pyaleph-node:${GITHUB_REF##*/} pyaleph --gen-keys --key-dir /opt/pyaleph/keys
37+
38+
- name: Ensure keys exists
39+
run: |
40+
ls keys/node-pub.key
41+
ls keys/node-secret.pkcs8.der

0 commit comments

Comments
 (0)