From e66ae6f9eac8766cc186ff8f8fb6da3dceb96cca Mon Sep 17 00:00:00 2001 From: ytshih Date: Wed, 6 Nov 2024 08:10:39 +0000 Subject: [PATCH] Initial commit --- .gitea/workflows/image.yml | 53 ++++++++++++++++++++++++++++++++++++++ Dockerfile | 8 ++++++ 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..4c79d59 --- /dev/null +++ b/.gitea/workflows/image.yml @@ -0,0 +1,53 @@ +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..a5a926e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM docker.io/node:22-alpine + +ADD rootca.pem /usr/local/share/ca-certificates/ +RUN apk --no-cache add --no-check-certificate ca-certificates \ + && update-ca-certificates --fresh + +ENTRYPOINT ["/usr/bin/env"] +CMD ["bash"]