Commit
·
865c0b7
1
Parent(s):
2b3ff54
add github action
Browse files
.github/workflows/docker-build.yml
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Build and Publish Docker Image
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches:
|
6 |
+
- main
|
7 |
+
- test-docker-build
|
8 |
+
workflow_dispatch: # Allow manual triggering
|
9 |
+
|
10 |
+
jobs:
|
11 |
+
build-and-push:
|
12 |
+
name: Build and Push Docker Image
|
13 |
+
runs-on: ubuntu-latest
|
14 |
+
|
15 |
+
steps:
|
16 |
+
- name: Checkout code
|
17 |
+
uses: actions/checkout@v3
|
18 |
+
|
19 |
+
- name: Set up QEMU
|
20 |
+
uses: docker/setup-qemu-action@v2
|
21 |
+
with:
|
22 |
+
platforms: 'arm64,amd64'
|
23 |
+
|
24 |
+
- name: Set up Docker Buildx
|
25 |
+
uses: docker/setup-buildx-action@v2
|
26 |
+
|
27 |
+
- name: Login to Docker Hub
|
28 |
+
uses: docker/login-action@v2
|
29 |
+
with:
|
30 |
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
31 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
32 |
+
|
33 |
+
- name: Build and push
|
34 |
+
uses: docker/build-push-action@v4
|
35 |
+
with:
|
36 |
+
context: .
|
37 |
+
file: .container/Dockerfile
|
38 |
+
platforms: linux/amd64,linux/arm64
|
39 |
+
push: true
|
40 |
+
tags: |
|
41 |
+
mugglejinx/owl:latest
|
42 |
+
mugglejinx/owl:${{ github.sha }}
|
43 |
+
cache-from: type=registry,ref=mugglejinx/owl:buildcache
|
44 |
+
cache-to: type=registry,ref=mugglejinx/owl:buildcache,mode=max
|