Skip to content

Commit

Permalink
Use github container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Nov 18, 2024
1 parent 23fddee commit bd999f3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/docker_build_and_push_to_dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
workflow_dispatch:

env:
REGISTRY: ghcr.io

jobs:
build_and_push_staging_docker_image:
runs-on: ubuntu-latest
Expand All @@ -16,19 +19,20 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
openbookpublishers/thoth
${{ env.REGISTRY }}/thoth-pub/thoth
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=pr,prefix=staging-pr-
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
- name: Login to Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
Expand All @@ -54,7 +58,7 @@ jobs:
uses: docker/build-push-action@v5
with:
push: false
tags: openbookpublishers/thoth:latest
tags: thoth-pub/thoth:latest
file: Dockerfile.dev
build-args: |
THOTH_GRAPHQL_API=https://api.thoth.pub
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/docker_build_and_push_to_dockerhub_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
release:
types: [published]

env:
REGISTRY: ghcr.io

jobs:
build_and_push_docker_image:
runs-on: ubuntu-latest
Expand All @@ -16,7 +19,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
openbookpublishers/thoth
${{ env.REGISTRY }}/thoth-pub/thoth
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
Expand All @@ -26,11 +29,12 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
- name: Login to Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The wasm APP needs to know the endpoint the API will be running at compile time,
docker build \
--build-arg THOTH_GRAPHQL_API=https://api.thoth.pub \
--build-arg THOTH_EXPORT_API=https://export.thoth.pub \
. -t openbookpublishers/thoth
. -t thoth-pub/thoth
```

## Acknowledgements
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
restart: unless-stopped

graphql-api:
image: openbookpublishers/thoth
image: ghcr.io/thoth-pub/thoth
container_name: "thoth_graphql_api"
restart: unless-stopped
env_file:
Expand All @@ -26,7 +26,7 @@ services:
- db

export-api:
image: openbookpublishers/thoth
image: ghcr.io/thoth-pub/thoth
container_name: "thoth_export_api"
restart: unless-stopped
command: ["start", "export-api"]
Expand All @@ -36,7 +36,7 @@ services:
- graphql-api

app:
image: openbookpublishers/thoth
image: ghcr.io/thoth-pub/thoth
container_name: "thoth_app"
restart: unless-stopped
command: ["start", "app"]
Expand Down

0 comments on commit bd999f3

Please sign in to comment.