Skip to content

Commit fb32650

Browse files
committed
Update on-tag.yml
1 parent 940eb34 commit fb32650

File tree

1 file changed

+7
-49
lines changed

1 file changed

+7
-49
lines changed

.github/workflows/on-tag.yml

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,18 @@ jobs:
2323
- backend
2424
runs-on: ubuntu-latest
2525
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
3127
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
4530
shell: bash
4631
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
5035
sudo chmod 600 /mnt/swapfile
5136
sudo mkswap /mnt/swapfile
52-
sudo swapon /mnt/swapfile || true
37+
sudo swapon /mnt/swapfile
5338
5439
- name: Show current memory and swap status
5540
shell: bash
@@ -59,7 +44,6 @@ jobs:
5944
sudo swapon --show
6045
6146
- name: Mount a tmpfs over /var/lib/docker
62-
if: matrix.runner-label == 'self-hosted'
6347
shell: bash
6448
run: |
6549
if [ ! -d "/var/lib/docker" ]; then
@@ -70,30 +54,6 @@ jobs:
7054
sudo systemctl restart docker
7155
sudo df -h | grep docker
7256
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-
9757
- name: Set env variables
9858
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
9959

@@ -107,7 +67,6 @@ jobs:
10767
- name: Login to Docker
10868
run: |
10969
docker login -u "sondreb" -p "${{secrets.DOCKER_KEY}}"
110-
11170
- name: Checkout project
11271
uses: actions/checkout@v4
11372

@@ -140,7 +99,6 @@ jobs:
14099
--cache-from "type=local,src=/tmp/.buildx-cache" \
141100
--cache-to "type=local,dest=/tmp/.buildx-cache" \
142101
--platform linux/amd64,linux/arm64 \
143-
--progress=plain \
144102
--tag blockcore/mempool-${{ matrix.service }}:$TAG \
145103
--tag blockcore/mempool-${{ matrix.service }}:latest \
146104
--build-context rustgbt=./rust \

0 commit comments

Comments
 (0)