iskoldt-X commited on
Commit
de386f1
·
unverified ·
1 Parent(s): d593331

Github actions!

Browse files
Files changed (1) hide show
  1. .github/workflows/Docker Images.yml +54 -0
.github/workflows/Docker Images.yml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and push Docker image
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+
8
+ jobs:
9
+ docker:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ -
13
+ name: Checkout
14
+ uses: actions/checkout@v3
15
+ -
16
+ name: Set release date
17
+ run: |
18
+ echo "RELEASE_DATE=$(date +%y.%m.%d)" >> ${GITHUB_ENV}
19
+ -
20
+ name: Set up QEMU
21
+ uses: docker/setup-qemu-action@v2
22
+ -
23
+ name: Set up Docker Buildx
24
+ uses: docker/setup-buildx-action@v2
25
+ -
26
+ name: Login to Docker Hub
27
+ uses: docker/login-action@v2
28
+ with:
29
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
30
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
31
+ -
32
+ name: Login to GitHub Container Registry
33
+ uses: docker/login-action@v2
34
+ with:
35
+ registry: ghcr.io
36
+ username: ${{ github.repository_owner }}
37
+ password: ${{ secrets.GITHUB_TOKEN }}
38
+ -
39
+ name: Owner names
40
+ run: |
41
+ GITOWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
42
+ echo "GITOWNER=$GITOWNER" >> ${GITHUB_ENV}
43
+ -
44
+ name: Build and push
45
+ uses: docker/build-push-action@v4
46
+ with:
47
+ context: .
48
+ platforms: linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/arm64,linux/arm/v7,linux/arm/v8
49
+ push: true
50
+ tags: |
51
+ ghcr.io/${{ env.GITOWNER }}/chuanhuchatgpt:latest
52
+ ghcr.io/${{ env.GITOWNER }}/chuanhuchatgpt:${{ env.RELEASE_DATE }}
53
+ ${{ secrets.DOCKERHUB_USERNAME }}/chuanhuchatgpt:latest
54
+ ${{ secrets.DOCKERHUB_USERNAME }}/chuanhuchatgpt:${{ env.RELEASE_DATE }}