From dec34cbde8bcae09cd100edaa3b747b6cf8fa712 Mon Sep 17 00:00:00 2001 From: ytshih Date: Fri, 18 Oct 2024 15:38:06 +0000 Subject: [PATCH] initial commit --- .gitea/workflows/image.yml | 52 ++++++++++++++++++++++++++++++++++++++ Dockerfile | 9 +++++++ 2 files changed, 61 insertions(+) create mode 100644 .gitea/workflows/image.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/image.yml b/.gitea/workflows/image.yml new file mode 100644 index 0000000..5e540ed --- /dev/null +++ b/.gitea/workflows/image.yml @@ -0,0 +1,52 @@ +name: Build image +on: [push] + +jobs: + release-image: + runs-on: imgbuilder + env: + CONTAINER_REGISTRY: gitea.konchin.com + GITEA_TAG: latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Root CA + run: | + echo "${{ vars.ROOTCA }}" | tee rootca.pem + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + config-inline: | + debug = true + [registry."${{ env.CONTAINER_REGISTRY }}"] + ca = ["rootca.pem"] + + - name: Login + uses: docker/login-action@v3 + with: + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Setup env + run: | + echo "GITEA_REPO=${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_ENV + echo "GITEA_REF_NAME=${GITHUB_REF_NAME}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + platforms: | + linux/amd64 + push: true + tags: | + ${{ env.CONTAINER_REGISTRY }}/${{ env.GITEA_REPO }}:${{ env.GITEA_REF_NAME }} + ${{ env.CONTAINER_REGISTRY }}/${{ env.GITEA_REPO }}:${{ env.GITEA_TAG }} + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..68e0df7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:22-alpine + +RUN apk add kubectl bash git +ADD rootca.pem /usr/local/share/ca-certificates/cacert.crt +RUN apk --no-cache add --no-check-certificate ca-certificates \ + && update-ca-certificates --fresh + +ENTRYPOINT ["/usr/bin/env"] +CMD ["bash"]