From 8e988192e22d1960c5417f5c240a2d4f64394a38 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 22 Jan 2024 21:13:04 +0100 Subject: [PATCH] Initial custom container build --- .gitea/workflows/release.yaml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 7 +++++++ VERSION | 1 + 3 files changed, 39 insertions(+) create mode 100644 .gitea/workflows/release.yaml create mode 100644 Dockerfile create mode 100644 VERSION diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..0768a29 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,31 @@ +name: Build restic container +on: + push: + branches: + - main + +jobs: + build: + name: Build image + runs-on: ubuntu-latest + container: ghcr.io/catthehacker/ubuntu:act-latest + env: + IMAGE_NAME: restic + REGISTRY: git.namesny.com + REPO_OWNER: cluster + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Registry + uses: docker/login-action@v3 + with: + registry: git.namesny.com + username: ${{ gitea.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + - name: Build and push + run: | + VERSION=$(cat VERSION) + docker build --build-arg="RESTIC_VERSION=${VERSION}" -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${VERSION} -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest . + docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${VERSION} + docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f1e7588 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM alpine:3 + +ARG RESTIC_VERSION + +RUN apk add restic=${RESTIC_VERSION} --no-cache +ENTRYPOINT ["/usr/bin/restic"] +CMD ["--help"] \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6ccd0f3 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.16.3-r0 \ No newline at end of file