Skip to content

Commit e357605

Browse files
committed
Add multi-arch social-agent image publishing
1 parent 3ff337f commit e357605

File tree

4 files changed

+47
-12
lines changed

4 files changed

+47
-12
lines changed

.github/workflows/social-agent.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,25 @@ jobs:
2828
run: |
2929
python -m unittest discover -s ./firewheel/model-components/social-agent/docker/tests -p "test_*.py" -v
3030
31+
docker-validate:
32+
needs: test
33+
runs-on: ubuntu-latest
34+
if: github.ref != 'refs/heads/main'
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
- name: Build social-agent Docker image for amd64
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: ./firewheel/model-components/social-agent/docker
46+
push: false
47+
load: false
48+
platforms: linux/amd64
49+
3150
publish:
3251
needs: test
3352
runs-on: ubuntu-latest
@@ -42,14 +61,20 @@ jobs:
4261
password: ${{ secrets.GITHUB_TOKEN }}
4362
- name: Checkout code
4463
uses: actions/checkout@v4
45-
- name: Build and push versioned Docker image
64+
- name: Set up QEMU
65+
uses: docker/setup-qemu-action@v3
66+
- name: Set up Docker Buildx
67+
uses: docker/setup-buildx-action@v3
68+
- name: Read social-agent version
69+
id: version
4670
run: |
47-
version=$( cat ./firewheel/model-components/social-agent/version.txt )
48-
docker build ./firewheel/model-components/social-agent/docker --tag ghcr.io/${{ github.repository }}/social-agent:$version
49-
docker push ghcr.io/${{ github.repository }}/social-agent:$version
50-
- name: Retag and push latest Docker image
51-
run: |
52-
version=$( cat ./firewheel/model-components/social-agent/version.txt )
53-
docker tag ghcr.io/${{ github.repository }}/social-agent:$version \
54-
ghcr.io/${{ github.repository }}/social-agent:latest
55-
docker push ghcr.io/${{ github.repository }}/social-agent:latest
71+
echo "value=$(cat ./firewheel/model-components/social-agent/version.txt)" >> "$GITHUB_OUTPUT"
72+
- name: Build and push multi-arch Docker image
73+
uses: docker/build-push-action@v6
74+
with:
75+
context: ./firewheel/model-components/social-agent/docker
76+
push: true
77+
platforms: linux/amd64,linux/arm64
78+
tags: |
79+
ghcr.io/${{ github.repository }}/social-agent:${{ steps.version.outputs.value }}
80+
ghcr.io/${{ github.repository }}/social-agent:latest
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.synchronic_web.social_agent.installed
2-
env/
2+
env/
3+
docker/custom-setup.sh

firewheel/model-components/social-agent/docker/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
FROM python:3.11.9-alpine3.19
22

33
WORKDIR /srv
4+
ARG CUSTOM_SETUP=""
5+
6+
RUN set -eu; \
7+
if [ -n "$CUSTOM_SETUP" ]; then \
8+
echo "$CUSTOM_SETUP" | base64 -d > /tmp/custom-setup.sh; \
9+
chmod +x /tmp/custom-setup.sh; \
10+
/bin/sh -eu /tmp/custom-setup.sh; \
11+
rm -f /tmp/custom-setup.sh; \
12+
fi
413

514
COPY ./requirements.txt ./requirements.txt
615

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.0.3

0 commit comments

Comments
 (0)