Skip to content

Commit c98b86a

Browse files
authored
Create docker-image.yml
1 parent 6925994 commit c98b86a

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: docker-image.yml
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
env:
9+
APP_NAME: anyAIProxyAPI
10+
DOCKERHUB_REPO: eceasy/any-ai-proxy-api
11+
12+
jobs:
13+
docker:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v1
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
- name: Login to DockerHub
23+
uses: docker/login-action@v1
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
- name: Generate App Version
28+
run: echo APP_VERSION=`git describe --tags --always` >> $GITHUB_ENV
29+
- name: Build and push
30+
uses: docker/build-push-action@v2
31+
with:
32+
context: .
33+
platforms: |
34+
linux/amd64
35+
linux/arm64
36+
push: true
37+
build-args: |
38+
APP_NAME=${{ env.APP_NAME }}
39+
APP_VERSION=${{ env.APP_VERSION }}
40+
tags: |
41+
${{ env.DOCKERHUB_REPO }}:latest
42+
${{ env.DOCKERHUB_REPO }}:${{ env.APP_VERSION }}

0 commit comments

Comments
 (0)