Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zatxm authored May 13, 2024
1 parent 287d8c3 commit 09112e8
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
name: Docker Image CI
name: Publish Docker image

on:
push:
tags:
- 'v*'
- '**'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

build:
- name: Get metadata for Docker
id: metadata
uses: docker/metadata-action@v5
with:
images: |
zatxm120/aiproxy
runs-on: ubuntu-latest
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

steps:
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build -t zatxm120/aiproxy .
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image to Docker Hub
run: |
docker tag zatxm120/aiproxy:latest zatxm120/aiproxy:${{ steps.get_version.outputs.VERSION }}
docker push zatxm120/aiproxy:${{ steps.get_version.outputs.VERSION }}
docker tag zatxm120/aiproxy:${{ steps.get_version.outputs.VERSION }} zatxm120/aiproxy:latest
docker push zatxm120/aiproxy:latest
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}

0 comments on commit 09112e8

Please sign in to comment.