From 5091ba45e9ca3d8fcdc42fe56b0250c4c5c804da Mon Sep 17 00:00:00 2001 From: royalcat Date: Sun, 31 Mar 2024 13:41:45 +0300 Subject: [PATCH] init --- .forgejo/workflows/docker.yaml | 54 ++++++++++++++++++++++++++++++++++ Dockerfile | 19 ++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .forgejo/workflows/docker.yaml create mode 100644 Dockerfile diff --git a/.forgejo/workflows/docker.yaml b/.forgejo/workflows/docker.yaml new file mode 100644 index 0000000..9a5e3a7 --- /dev/null +++ b/.forgejo/workflows/docker.yaml @@ -0,0 +1,54 @@ +name: docker + +on: + push: + branches: + - master + tags: + - "v*" + +jobs: + build-docker: + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: git.kmsign.ru + username: ${{ github.actor }} + password: ${{ secrets.PACKAGE_TOKEN }} + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: https://github.com/docker/metadata-action@v5 + with: + images: git.kmsign.ru/${{ github.repository }} + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + pull: true + platforms: linux/amd64,linux/arm64 + labels: ${{ steps.meta.outputs.labels }} + sbom: true + provenance: true + tags: ${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8c8a223 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM code.forgejo.org/forgejo/runner:3.4.1 AS runner + +FROM docker:26-dind-rootless + +USER root +RUN apk add --no-cache git bash +USER rootless + +COPY --from=runner /bin/forgejo-runner /bin/forgejo-runner + +ENV HOME=/data + +USER 1000:1000 + +WORKDIR /data + +VOLUME ["/data"] + +CMD ["/bin/forgejo-runner"]