@@ -23,33 +23,18 @@ jobs:
23
23
- backend
24
24
runs-on : ubuntu-latest
25
25
timeout-minutes : 120
26
- name : Build ${{ matrix.service }} on ${{ matrix.runner-label }}
27
- concurrency :
28
- group : ${{ github.workflow }}-${{ github.ref }}-${{ matrix.service }}-${{ matrix.runner-label }}
29
- cancel-in-progress : true
30
-
26
+ name : Build and push to DockerHub
31
27
steps :
32
- - name : Runner check
33
- id : runner-check
34
- run : |
35
- echo "Running on ${{ matrix.runner-label }}"
36
- if [ "${{ matrix.runner-label }}" = "self-hosted" ]; then
37
- echo "Using self-hosted runner"
38
- else
39
- echo "Using GitHub-hosted runner"
40
- fi
41
-
42
- # Skip swap configuration for GitHub-hosted runners
43
- - name : Configure swap
44
- if : matrix.runner-label == 'self-hosted'
28
+ # Workaround based on JonasAlfredsson/[email protected]
29
+ - name : Replace the current swap file
45
30
shell : bash
46
31
run : |
47
- sudo swapoff /mnt/swapfile || true
48
- sudo rm -f /mnt/swapfile || true
49
- sudo fallocate -l 13G /mnt/swapfile || true
32
+ sudo swapoff /mnt/swapfile
33
+ sudo rm -v /mnt/swapfile
34
+ sudo fallocate -l 13G /mnt/swapfile
50
35
sudo chmod 600 /mnt/swapfile
51
36
sudo mkswap /mnt/swapfile
52
- sudo swapon /mnt/swapfile || true
37
+ sudo swapon /mnt/swapfile
53
38
54
39
- name : Show current memory and swap status
55
40
shell : bash
59
44
sudo swapon --show
60
45
61
46
- name : Mount a tmpfs over /var/lib/docker
62
- if : matrix.runner-label == 'self-hosted'
63
47
shell : bash
64
48
run : |
65
49
if [ ! -d "/var/lib/docker" ]; then
70
54
sudo systemctl restart docker
71
55
sudo df -h | grep docker
72
56
73
- - name : Cache Cargo registry
74
- uses : actions/cache@v3
75
- with :
76
- path : ~/.cargo/registry
77
- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
78
- restore-keys : |
79
- ${{ runner.os }}-cargo-registry-
80
-
81
- - name : Cache Cargo index
82
- uses : actions/cache@v3
83
- with :
84
- path : ~/.cargo/index
85
- key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
86
- restore-keys : |
87
- ${{ runner.os }}-cargo-index-
88
-
89
- - name : Cache Cargo build
90
- uses : actions/cache@v3
91
- with :
92
- path : target
93
- key : ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
94
- restore-keys : |
95
- ${{ runner.os }}-cargo-build-
96
-
97
57
- name : Set env variables
98
58
run : echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
99
59
107
67
- name : Login to Docker
108
68
run : |
109
69
docker login -u "sondreb" -p "${{secrets.DOCKER_KEY}}"
110
-
111
70
- name : Checkout project
112
71
uses : actions/checkout@v4
113
72
140
99
--cache-from "type=local,src=/tmp/.buildx-cache" \
141
100
--cache-to "type=local,dest=/tmp/.buildx-cache" \
142
101
--platform linux/amd64,linux/arm64 \
143
- --progress=plain \
144
102
--tag blockcore/mempool-${{ matrix.service }}:$TAG \
145
103
--tag blockcore/mempool-${{ matrix.service }}:latest \
146
104
--build-context rustgbt=./rust \
0 commit comments