Skip to content

Commit

Permalink
chore: refactor the github action for release an image
Browse files Browse the repository at this point in the history
  • Loading branch information
paopa committed Jul 10, 2024
1 parent 0c3b76b commit 6d4b73a
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/ai-service-release-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
else
tag_name=commit-$(git log -1 --pretty=%h)
fi
echo "TAG_NAME=$tag_name" >> $GITHUB_OUTPUT
echo "TAG_NAME=$tag_name" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -38,12 +38,18 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
env:
TAG_NAME: ${{ steps.tag-preparation.outputs.TAG_NAME }}
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/canner/wren-ai-service:$TAG_NAME \
--file ./docker/Dockerfile \
--push .
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/canner/wren-ai-service
tags: |
type=raw,${{ env.TAG_NAME }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
context: ./wren-ai-service
file: ./docker/Dockerfile

0 comments on commit 6d4b73a

Please sign in to comment.