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
0 commit comments