-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |