commit 4de7eb13e2560310aca77908d4db5b1cb6b0f2aa Author: Bruno Carlin Date: Sun Jan 5 04:03:09 2025 +0100 initial commit diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..3049979 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,33 @@ +name: Verifies PR +on: + pull_request: + types: + - synchronize + push: + branches: + - main + schedule: + - cron: '0 0 * * *' + workflow_dispatch: {} +jobs: + build: + runs-on: docker + steps: + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: latest + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: code.bcarlin.net + username: ${{ github.actor }} + password: ${{ github.token }} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + pull: true + tags: code.bcarlin.net/oci/browsers:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4798a5f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:latest + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install --yes apt-utils 2>&1 | grep -v "debconf: delaying package configuration, since apt-utils is not installed" \ + && apt-get install --no-install-recommends --yes \ + fontconfig \ + chromium-browser \ + nodejs \ + && rm -rf /var/lib/apt/lists/* + diff --git a/check-image.sh b/check-image.sh new file mode 100755 index 0000000..16be85a --- /dev/null +++ b/check-image.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +LOCAL_IMAGE=$1 +REMOTE_IMAGE=$2 + +# Vérifier si le nom de l'image a été fourni +if [[ -z "$LOCAL_IMAGE" || -z "$REMOTE_IMAGE" ]]; then + echo "Usage: $0 " + exit 1 +fi + +REMOTE_IMAGE_DIGEST=$(curl -s "https://hub.docker.com/v2/repositories/$REMOTE_IMAGE/tags/latest/" | jq .digest) + +RESULT=$(docker image inspect "$LOCAL_IMAGE" | jq '[[.[0].RepoDigests.[] | split("@")].[] | last] | unique | contains(['"$REMOTE_IMAGE_DIGEST"'])') + +if [[ "$RESULT" == "true" ]]; then + exit 0 +else + exit 1 +fi