binary-husky commited on
Commit
b1154b3
1 Parent(s): 4f0cd42

Update docker-image.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/docker-image.yml +30 -10
.github/workflows/docker-image.yml CHANGED
@@ -1,18 +1,38 @@
1
- name: Docker Image CI
2
 
3
  on:
4
  push:
5
- branches: [ "master" ]
6
- pull_request:
7
- branches: [ "master" ]
8
 
9
- jobs:
10
-
11
- build:
 
12
 
 
 
13
  runs-on: ubuntu-latest
14
 
15
  steps:
16
- - uses: actions/checkout@v3
17
- - name: Build the Docker image
18
- run: docker build . --file Dockerfile --tag gpt-no-local-llms:$(date +%s)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Build and push Docker image
2
 
3
  on:
4
  push:
5
+ branches:
6
+ - main
 
7
 
8
+ env:
9
+ DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
10
+ DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
11
+ IMAGE_NAME: example-image
12
 
13
+ jobs:
14
+ build-and-push:
15
  runs-on: ubuntu-latest
16
 
17
  steps:
18
+ # Checkout the repository
19
+ - name: Checkout repository
20
+ uses: actions/checkout@v2
21
+
22
+ # Set up Docker Buildx
23
+ - name: Set up Docker Buildx
24
+ uses: docker/setup-buildx-action@v1
25
+
26
+ # Set up GitHub Packages registry
27
+ - name: Set up GitHub Packages registry
28
+ run: |
29
+ echo "${DOCKER_PASSWORD}" | docker login ghcr.io -u "${DOCKER_USERNAME}" --password-stdin
30
+
31
+ # Build and push the Docker image
32
+ - name: Build and push Docker image
33
+ uses: docker/build-push-action@v2
34
+ with:
35
+ context: .
36
+ file: docs/Dockerfile+NoLocal
37
+ push: true
38
+ tags: ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest