Skip to content

Commit 9b5ce34

Browse files
authored
Update docker-deploy.yml
1 parent f759d71 commit 9b5ce34

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.github/workflows/docker-deploy.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ env:
1414
jobs:
1515
build:
1616
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
timeout-minutes: 60
1721

1822
steps:
1923
- name: validate input
@@ -27,15 +31,17 @@ jobs:
2731
with:
2832
fetch-depth: 1
2933

30-
- name: docker build
31-
run: |
32-
cd docker/${DOCKER_IMAGE_NAME1}
33-
docker build -t ghcr.io/shimat/opencvsharp/${DOCKER_IMAGE_NAME1}:${{ github.event.inputs.docker_image_tag }} .
34-
35-
- name: docker login
36-
run: |
37-
echo ${{secrets.GH_PACKAGES_PAT}} | docker login ghcr.io -u shimat --password-stdin
38-
39-
- name: docker push
40-
run: |
41-
docker push ghcr.io/shimat/opencvsharp/${DOCKER_IMAGE_NAME1}:${{ github.event.inputs.docker_image_tag }}
34+
- name: Log into registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ghcr.io
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Build and push Docker image
42+
id: build-and-push
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: docker/${{ env.DOCKER_IMAGE_NAME1 }}
46+
push: true
47+
tags: ghcr.io/shimat/opencvsharp/${{ env.DOCKER_IMAGE_NAME1 }}:${{ github.event.inputs.docker_image_tag }}

0 commit comments

Comments
 (0)