diff --git a/.env b/.env index 073ecf9..ddc4495 100644 --- a/.env +++ b/.env @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d1ba4e..d5e552d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/README.md b/README.md index 09eb031..9736955 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 ``` diff --git a/app/http.php b/app/http.php index aa9e5e0..14bbc85 100644 --- a/app/http.php +++ b/app/http.php @@ -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; diff --git a/docker-compose.yml b/docker-compose.yml index c8d9ea6..385ba6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: