Skip to content

Commit

Permalink
feat: ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Nov 6, 2023
1 parent d379d9e commit 83fb248
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ OPR_EXECUTOR_NETWORK=openruntimes-runtimes
OPR_EXECUTOR_SECRET=executor-secret-key
OPR_EXECUTOR_LOGGING_PROVIDER=
OPR_EXECUTOR_LOGGING_CONFIG=
OPR_EXECUTOR_DOCKER_HUB_USERNAME=
OPR_EXECUTOR_DOCKER_HUB_PASSWORD=
OPR_EXECUTOR_DOCKER_USERNAME=
OPR_EXECUTOR_DOCKER_PASSWORD=
OPR_EXECUTOR_RUNTIME_VERSIONS=v3
32 changes: 20 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,45 @@ on:
types: [published]

env:
IMAGE_NAME: openruntimes/executor
TAG: ${{ github.event.release.tag_name }}
USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: type=semver,pattern={{major}}.{{minor}}.{{patch}}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
build-args: |
OPR_EXECUTOR_VERSION=${{ env.TAG }}
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
OPR_EXECUTOR_VERSION=${{ steps.meta.outputs.version }}
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ env.TAG }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ services:
- OPR_EXECUTOR_SECRET
- OPR_EXECUTOR_LOGGING_PROVIDER
- OPR_EXECUTOR_LOGGING_CONFIG
- OPR_EXECUTOR_DOCKER_HUB_USERNAME
- OPR_EXECUTOR_DOCKER_HUB_PASSWORD
- OPR_EXECUTOR_DOCKER_USERNAME=
- OPR_EXECUTOR_DOCKER_PASSWORD=
- OPR_EXECUTOR_RUNTIME_VERSIONS

networks:
Expand All @@ -84,8 +84,8 @@ OPR_EXECUTOR_NETWORK=openruntimes-runtimes
OPR_EXECUTOR_SECRET=executor-secret-key
OPR_EXECUTOR_LOGGING_PROVIDER=
OPR_EXECUTOR_LOGGING_CONFIG=
OPR_EXECUTOR_DOCKER_HUB_USERNAME=
OPR_EXECUTOR_DOCKER_HUB_PASSWORD=
OPR_EXECUTOR_DOCKER_USERNAME=
OPR_EXECUTOR_DOCKER_PASSWORD=
OPR_EXECUTOR_RUNTIME_VERSIONS=v3
```

Expand Down
4 changes: 2 additions & 2 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
* Create orchestration
*/
$register->set('orchestration', function () {
$dockerUser = (string) App::getEnv('OPR_EXECUTOR_DOCKER_HUB_USERNAME', '');
$dockerPass = (string) App::getEnv('OPR_EXECUTOR_DOCKER_HUB_PASSWORD', '');
$dockerUser = (string) App::getEnv('OPR_EXECUTOR_DOCKER_USERNAME', '');
$dockerPass = (string) App::getEnv('OPR_EXECUTOR_DOCKER_PASSWORD', '');
$orchestration = new Orchestration(new DockerCLI($dockerUser, $dockerPass));

return $orchestration;
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ services:
- OPR_EXECUTOR_SECRET
- OPR_EXECUTOR_LOGGING_PROVIDER
- OPR_EXECUTOR_LOGGING_CONFIG
- OPR_EXECUTOR_DOCKER_HUB_USERNAME
- OPR_EXECUTOR_DOCKER_HUB_PASSWORD
- OPR_EXECUTOR_DOCKER_USERNAME
- OPR_EXECUTOR_DOCKER_PASSWORD
- OPR_EXECUTOR_RUNTIME_VERSIONS

networks:
Expand Down

0 comments on commit 83fb248

Please sign in to comment.