Mythus commited on
Commit
7146a33
·
verified ·
1 Parent(s): e37b01a

Upload docker-build-push.yml

Browse files
.github/workflows/docker-build-push.yml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Docker Build and Push
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ # release:
8
+ # types: [created]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ build-and-push:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write
16
+ packages: write
17
+ security-events: write
18
+
19
+ steps:
20
+ - name: Checkout code
21
+ uses: actions/checkout@v4.1.2
22
+
23
+ - name: Docker Setup QEMU
24
+ uses: docker/setup-qemu-action@v3
25
+ id: qemu
26
+ with:
27
+ platforms: amd64,arm64
28
+
29
+ - name: Log into ghcr.io registry
30
+ uses: docker/login-action@v3.1.0
31
+ with:
32
+ registry: ghcr.io
33
+ username: ${{ github.repository_owner }}
34
+ password: ${{ secrets.GITHUB_TOKEN }}
35
+
36
+ - name: Set up Docker Buildx
37
+ uses: docker/setup-buildx-action@v3.2.0
38
+
39
+ - name: Log in to Docker Hub
40
+ uses: docker/login-action@v3.1.0
41
+ with:
42
+ username: ${{ secrets.DOCKER_HUB_USERNAME }}
43
+ password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
44
+
45
+ - name: Build and push Docker image
46
+ uses: docker/build-push-action@v5.3.0
47
+ with:
48
+ context: .
49
+ file: ./Dockerfile
50
+ platforms: linux/amd64,linux/arm64
51
+ push: true
52
+ cache-from: type=gha
53
+ cache-to: type=gha,mode=max
54
+ tags: |
55
+ ghcr.io/g0ldyy/comet:latest
56
+ docker.io/g0ldyy/comet:latest