push to docker hub
Browse filesset docker image name
- .github/workflows/main.yml +18 -8
.github/workflows/main.yml
CHANGED
@@ -8,15 +8,25 @@ on:
|
|
8 |
|
9 |
jobs:
|
10 |
build:
|
|
|
11 |
runs-on: self-hosted
|
12 |
steps:
|
13 |
- name: Checkout
|
14 |
uses: actions/checkout@v3
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
- name: Set up Docker Buildx
|
21 |
uses: docker/setup-buildx-action@v2
|
22 |
- name: Build
|
@@ -24,6 +34,6 @@ jobs:
|
|
24 |
with:
|
25 |
context: .
|
26 |
file: ./Dockerfile
|
27 |
-
push:
|
28 |
-
tags:
|
29 |
-
|
|
|
8 |
|
9 |
jobs:
|
10 |
build:
|
11 |
+
if: github.repository_owner == 'OpenAccess-AI-Collective'
|
12 |
runs-on: self-hosted
|
13 |
steps:
|
14 |
- name: Checkout
|
15 |
uses: actions/checkout@v3
|
16 |
+
- name: Docker metadata
|
17 |
+
id: metadata
|
18 |
+
uses: docker/metadata-action@v3
|
19 |
+
with:
|
20 |
+
images: winglian/axolotl
|
21 |
+
tags: |
|
22 |
+
type=semver,pattern={{version}}
|
23 |
+
type=semver,pattern={{major}}.{{minor}}
|
24 |
+
type=raw,value={{sha}},enable=${{ github.ref_type != 'tag' }}
|
25 |
+
- name: Login to Docker Hub
|
26 |
+
uses: docker/login-action@v2
|
27 |
+
with:
|
28 |
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
29 |
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
30 |
- name: Set up Docker Buildx
|
31 |
uses: docker/setup-buildx-action@v2
|
32 |
- name: Build
|
|
|
34 |
with:
|
35 |
context: .
|
36 |
file: ./Dockerfile
|
37 |
+
push: ${{ github.event.base_ref =='refs/heads/main' && github.ref_type == 'tag' && !startsWith(github.ref, 'refs/tags/v0.')}}
|
38 |
+
tags: ${{ steps.metadata.outputs.tags }}
|
39 |
+
labels: ${{ steps.metadata.outputs.labels }}
|