Skip to content

Commit 6726c3b

Browse files
authored
add CD
1 parent 1657596 commit 6726c3b

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/docker.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
workflow_dispatch: # run manually
7+
8+
jobs:
9+
10+
deploy:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
packages: write
15+
contents: read
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
# we need tags for docker version tagging
21+
fetch-tags: true
22+
fetch-depth: 0
23+
- # Activate cache export feature to reduce build time of images
24+
name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
- name: Login to GitHub Container Registry
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Log in to Docker Hub
33+
uses: docker/login-action@v3
34+
with:
35+
username: ${{ secrets.DOCKERIO_USERNAME }}
36+
password: ${{ secrets.DOCKERIO_PASSWORD }}
37+
- name: Build the Docker image
38+
# build both tags at the same time
39+
run: make docker DOCKER_TAG="docker.io/ocrd/kraken -t ghcr.io/ocr-d/kraken"
40+
- name: Test the Docker image
41+
run: docker run --rm ocrd/kraken ocrd-kraken-segment -h
42+
- name: Push to Dockerhub
43+
run: docker push docker.io/ocrd/kraken
44+
- name: Push to Github Container Registry
45+
run: docker push ghcr.io/ocr-d/kraken

0 commit comments

Comments
 (0)