From 97cfc59bb64ab631161e0ca22b8d815af75b44ec Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sat, 19 Aug 2023 18:15:46 +0200 Subject: [PATCH] feature: migrate to container.localdomain and add actions workflow to build --- .github/workflows/main.yaml | 39 +++++++++++++++++++++++++++++++++++++ Makefile | 2 +- docker-entrypoint.sh | 6 ++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..3539f1e --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,39 @@ +name: Main + +on: + push: + branches: + - master + +env: + REGISTRY_NAME: container.localdomain:5000 + +jobs: + build: + runs-on: docker + container: + image: catthehacker/ubuntu:act-22.04 + steps: + - uses: RouxAntoine/checkout@v3.5.4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2.9.1 + with: + config-inline: | + [registry."${{ env.REGISTRY_NAME }}"] + http = true + + - name: Build and push + uses: docker/build-push-action@v4 + env: + ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + with: + context: . + push: true + tags: ${{ env.REGISTRY_NAME }}/perkeep:latest + platforms: | + linux/amd64 + linux/arm64 diff --git a/Makefile b/Makefile index 4267e05..d850d91 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: imagePerkeep -REGISTRY_NAME=docker.registry +REGISTRY_NAME=container.localdomain # linux/arm/v7 # linux/arm/v6 # linux/arm64 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 30058f1..36d5aa7 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,6 +5,12 @@ then return 1; fi +if [ "T$SECRING" != "T" ] && [ "T$IDENTITY" != "T" ]; +then + echo "$SECRING" > /perkeep/config/identity-secring.gpg + envsubst < /perkeep/config/server-config-custom.tpl.json > /perkeep/config/server-config-custom.json +fi + if [ ! -f /perkeep/config/identity-secring.gpg ]; then pk put init -newkey