Skip to content

Commit 10f1466

Browse files
committed
Attempt to automatically build for Docker Hub and the GitHub Container Registry.
1 parent a52eae8 commit 10f1466

1 file changed

Lines changed: 33 additions & 7 deletions

File tree

.github/workflows/docker.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,46 @@
11
name: Publish Docker image
2+
23
on:
34
push:
45
tags:
56
- 'v*'
7+
68
jobs:
7-
push_to_registry:
8-
name: Push Docker image to GitHub Packages
9+
push_to_registries:
10+
name: Push Docker image to multiple registries
911
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
14+
contents: read
1015
steps:
1116
- name: Check out the repo
1217
uses: actions/checkout@v2
13-
- name: Push to GitHub Packages
14-
uses: docker/build-push-action@v1
18+
19+
- name: Log in to Docker Hub
20+
uses: docker/login-action@v1
1521
with:
22+
username: ${{ secrets.DOCKER_USERNAME }}
23+
password: ${{ secrets.DOCKER_TOKEN }}
24+
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v1
27+
with:
28+
registry: ghcr.io
1629
username: ${{ github.actor }}
1730
password: ${{ secrets.GITHUB_TOKEN }}
18-
registry: ghcr.io
19-
repository: tech10/nvdaremoteserver-docker
20-
tag_with_ref: true
31+
32+
- name: Extract metadata (tags, labels) for Docker
33+
id: meta
34+
uses: docker/metadata-action@v3
35+
with:
36+
images: |
37+
tech10/nvdaremoteserver
38+
ghcr.io/tech10/nvdaremoteserver-docker
39+
40+
- name: Build and push Docker images
41+
uses: docker/build-push-action@v2
42+
with:
43+
context: .
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)