Spaces:
Sleeping
Sleeping
binary-husky
commited on
Commit
•
b1154b3
1
Parent(s):
4f0cd42
Update docker-image.yml
Browse files
.github/workflows/docker-image.yml
CHANGED
@@ -1,18 +1,38 @@
|
|
1 |
-
name: Docker
|
2 |
|
3 |
on:
|
4 |
push:
|
5 |
-
branches:
|
6 |
-
|
7 |
-
branches: [ "master" ]
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
12 |
|
|
|
|
|
13 |
runs-on: ubuntu-latest
|
14 |
|
15 |
steps:
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|