bibibi12345 commited on
Commit
e9203c4
·
unverified ·
1 Parent(s): 7238a45

Update docker-image.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/docker-image.yml +15 -45
.github/workflows/docker-image.yml CHANGED
@@ -1,53 +1,23 @@
1
- name: Build and Push Docker Image
2
 
3
  on:
4
- workflow_dispatch:
5
- push:
6
- tags:
7
- - "*"
8
 
9
  jobs:
10
- build-and-push:
11
- runs-on: ubuntu-latest
12
- permissions:
13
- packages: write
14
- contents: read
15
- steps:
16
- - name: Checkout repository
17
- uses: actions/checkout@v4
18
 
19
- - name: Set up QEMU
20
- uses: docker/setup-qemu-action@v3
21
 
22
- - name: Set up Docker Buildx
23
- uses: docker/setup-buildx-action@v3
24
 
25
- - name: Login to GitHub Container Registry
26
- uses: docker/login-action@v2
27
- with:
28
- registry: ghcr.io
29
- username: ${{ github.actor }}
30
- password: ${{ secrets.AUTH_TOKEN }}
31
 
32
- - name: Extract tag name
33
- if: ${{ github.event_name != 'workflow_dispatch' }}
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