Switch all images to the new registry (#1109)

* Switch all images to the new registry

* Update compose files

* Update Readme

* Fix several merge issues.

---------

Co-authored-by: Konstantin Koval
This commit is contained in:
Kostiantyn
2024-11-03 08:42:37 +02:00
committed by GitHub
parent 0d5225e542
commit 0fb6636ead
5 changed files with 59 additions and 39 deletions

View File

@@ -14,10 +14,10 @@ on:
env:
IS_PUSHING_IMAGES: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }}
# IS_PUSHING_IMAGES: true # Switch on when pushing images with forked repos.
DOCKER_REGISTRY: ${{ (github.repository == 'photoview/photoview' && '') || 'ghcr.io/' }}
DOCKER_REGISTRY: ${{ github.repository != 'photoview/photoview' && 'ghcr.io/' || '' }}
DOCKER_USERNAME: viktorstrate
DOCKER_IMAGE: ${{ (github.repository == 'photoview/photoview' && 'viktorstrate/photoview') || github.repository }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_IMAGE: ${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
jobs:
@@ -91,9 +91,9 @@ jobs:
if: ${{ env.IS_PUSHING_IMAGES == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' }}
username: ${{ ( env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor ) || env.DOCKER_USERNAME }}
password: ${{ ( env.DOCKER_REGISTRY == 'ghcr.io/' && github.token ) || env.DOCKER_PASSWORD }}
registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' || '' }}
username: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor || env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.token || env.DOCKER_PASSWORD }}
- name: Docker meta
id: docker_meta
@@ -114,17 +114,17 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
sbom: true
provenance: mode=max
platforms: ${{ env.PLATFORMS }}
pull: true
push: ${{ env.IS_PUSHING_IMAGES }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
context: .
sbom: true
provenance: mode=max
platforms: ${{ env.PLATFORMS }}
pull: true
push: ${{ env.IS_PUSHING_IMAGES }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
annotations: ${{ steps.docker_meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
NODE_ENV=production
VERSION=${{ github.ref_name }}
@@ -140,6 +140,7 @@ jobs:
fail-fast: false
matrix:
tags: ${{ fromJson(needs.prepare.outputs.tags) }}
# Comment out when pushing images with forked repos.
if: ${{ github.event_name != 'pull_request' && github.repository == 'photoview/photoview' }}
steps:
# Makes sure your .dockleignore file is available to the next step
@@ -151,8 +152,9 @@ jobs:
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
registry: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && 'ghcr.io' || '' }}
username: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.actor || env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_REGISTRY == 'ghcr.io/' && github.token || env.DOCKER_PASSWORD }}
- name: Run Dockle for '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
id: dockle
@@ -160,12 +162,12 @@ jobs:
continue-on-error: true
uses: erzz/dockle-action@v1
with:
image: '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
report-name: dockle-results-${{ matrix.tags.tag }}
report-format: sarif
image: '${{ env.DOCKER_REGISTRY }}${{ env.DOCKER_IMAGE }}:${{ matrix.tags.tag }}'
report-name: dockle-results-${{ matrix.tags.tag }}
report-format: sarif
failure-threshold: fatal
exit-code: 1
timeout: 5m
exit-code: 1
timeout: 5m
- name: Upload SARIF file
if: ${{ steps.dockle.conclusion == 'success' }}