initial commit
This commit is contained in:
commit
4de7eb13e2
3 changed files with 65 additions and 0 deletions
33
.forgejo/workflows/build.yaml
Normal file
33
.forgejo/workflows/build.yaml
Normal file
|
@ -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
|
12
Dockerfile
Normal file
12
Dockerfile
Normal file
|
@ -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/*
|
||||
|
20
check-image.sh
Executable file
20
check-image.sh
Executable file
|
@ -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 <LOCAL_IMAGE> <REMOTE_IMAGE>"
|
||||
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
|
Loading…
Reference in a new issue