Spaces:
Running
Running
Update docker-image.yml
Browse files
.github/workflows/docker-image.yml
CHANGED
@@ -1,53 +1,23 @@
|
|
1 |
-
name:
|
2 |
|
3 |
on:
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
|
9 |
jobs:
|
10 |
-
|
11 |
-
|
12 |
-
permissions:
|
13 |
-
packages: write
|
14 |
-
contents: read
|
15 |
-
steps:
|
16 |
-
- name: Checkout repository
|
17 |
-
uses: actions/checkout@v4
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
with:
|
28 |
-
registry: ghcr.io
|
29 |
-
username: ${{ github.actor }}
|
30 |
-
password: ${{ secrets.AUTH_TOKEN }}
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
id: get_tag
|
35 |
-
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
36 |
-
|
37 |
-
- name: Extract metadata (tags, labels) for Docker
|
38 |
-
id: meta
|
39 |
-
uses: docker/metadata-action@v4
|
40 |
-
with:
|
41 |
-
images: ghcr.io/${{ github.repository }}
|
42 |
-
tags: |
|
43 |
-
type=raw,value=test,enable=${{ github.event_name == 'workflow_dispatch' }}
|
44 |
-
type=ref,event=tag,enable=${{ github.event_name != 'workflow_dispatch' }}
|
45 |
-
type=raw,value=latest,enable=${{ github.event_name != 'workflow_dispatch' }}
|
46 |
-
|
47 |
-
- name: Build and push Docker image
|
48 |
-
uses: docker/build-push-action@v6
|
49 |
-
with:
|
50 |
-
context: .
|
51 |
-
push: true
|
52 |
-
tags: ${{ steps.meta.outputs.tags }}
|
53 |
-
labels: ${{ steps.meta.outputs.labels }}
|
|
|
1 |
+
name: Docker Image CI
|
2 |
|
3 |
on:
|
4 |
+
push:
|
5 |
+
branches: [ "main" ]
|
6 |
+
pull_request:
|
7 |
+
branches: [ "main" ]
|
8 |
|
9 |
jobs:
|
10 |
+
build:
|
11 |
+
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
steps:
|
14 |
+
- uses: actions/checkout@v4
|
15 |
|
16 |
+
- name: Log in to GitHub Container Registry
|
17 |
+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
18 |
|
19 |
+
- name: Build the Docker image
|
20 |
+
run: docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/vertex2openai:latest
|
|
|
|
|
|
|
|
|
21 |
|
22 |
+
- name: Push the Docker image
|
23 |
+
run: docker push ghcr.io/${{ github.repository_owner }}/vertex2openai:latest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|