-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (110 loc) · 3.83 KB
/
docker.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Publish Docker image
on:
pull_request:
push:
branches:
- main
jobs:
push_to_registry:
name: Push Docker image to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo Cache
id: cache
uses: actions/cache@v4
with:
path: |
cargo-registry-cache
sccache-cache
key: ${{ runner.os }}-cargo-cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-cache
- name: inject cargo caches into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"cargo-registry-cache": "/usr/local/cargo/registry",
"sccache-cache": "/sccache"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Extract Docker metadata for firefly-cardanoconnect
id: firefly-cardanoconnect-meta
uses: docker/[email protected]
with:
images: ghcr.io/blockfrost/firefly-cardanoconnect
- name: Build and push Docker image for firefly-cardanoconnect
id: firefly-cardanoconnect-push
uses: docker/[email protected]
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: ./Dockerfile
target: firefly-cardanoconnect
push: true
tags: ${{ steps.firefly-cardanoconnect-meta.outputs.tags }}
labels: ${{ steps.firefly-cardanoconnect-meta.outputs.labels }}
- name: Extract Docker metadata for firefly-cardanosigner
id: firefly-cardanosigner-meta
uses: docker/[email protected]
with:
images: ghcr.io/blockfrost/firefly-cardanosigner
- name: Build and push Docker image for firefly-cardanosigner
id: firefly-cardanosigner-push
uses: docker/[email protected]
with:
registry: ghcr.io
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: ./Dockerfile
target: firefly-cardanosigner
push: true
tags: ${{ steps.firefly-cardanosigner-meta.outputs.tags }}
labels: ${{ steps.firefly-cardanosigner-meta.outputs.labels }}
demo:
name: Run Demo
runs-on: ubuntu-latest
needs: push_to_registry
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Add wallet secret
run: mkdir ./infra/wallet ; echo '${{ secrets.DEMO_WALLET }}' > ./infra/wallet/addr_test1vqhkukz0285zvk0xrwk9jlq0075tx6furuzcjvzpnhtgelsuhhqc4.skey
- name: Start docker-compose
run: docker compose -f ./infra/docker-compose.yaml -p preview up -d --no-build
env:
BLOCKFROST_KEY: ${{ secrets.BLOCKFROST_KEY }}
- name: Add just
uses: extractions/setup-just@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
- name: Logs
run: |
docker compose -f ./infra/docker-compose.yaml -p preview logs
docker ps -a
- name: Run demo
env:
ADDR_FROM: addr_test1vqhkukz0285zvk0xrwk9jlq0075tx6furuzcjvzpnhtgelsuhhqc4
ADDR_TO: addr_test1vqeux7xwusdju9dvsj8h7mca9aup2k439kfmwy773xxc2hcu7zy99
run: just demo