diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..64cb46b --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,91 @@ +name: "Build Runner Images" + +on: + schedule: + - cron: "0 0 * * *" + push: + branches: + - "main" + +jobs: + base: + runs-on: "ubuntu-latest" + steps: + - name: Login to Registry + uses: "actions/docker-login@v3" + with: + registry: git.kjan.de + username: ${{ secrets.DEPLOY_USER }} + password: ${{ secrets.DEPLOY_SECRET }} + - name: Build and push base image + id: build_base + uses: "actions/docker-build-push@v5" + with: + context: "{{defaultContext}}:images/actions/act" + push: true + tags: | + git.kjan.de/actions/runner-basic:latest + git.kjan.de/actions/runner-basic:${{ github.run_number }} + + extended-latest: + runs-on: "docker" + needs: + - base + strategy: + matrix: + language: ["go", "js", "protobuf", "oas", "just"] + steps: + - name: Login to Registry + uses: "actions/docker-login@v3" + with: + registry: git.kjan.de + username: ${{ secrets.DEPLOY_USER }} + password: ${{ secrets.DEPLOY_SECRET }} + + - name: Build and push ${{ matrix.language }} image + uses: "actions/docker-build-push@v5" + with: + context: "{{defaultContext}}:images/actions/${{ matrix.language }}" + push: true + tags: | + git.kjan.de/actions/runner-${{ matrix.language }}:latest + git.kjan.de/actions/runner-${{ matrix.language }}:${{ github.run_number }} + + extended-versioned: + runs-on: "docker" + needs: + - base + strategy: + matrix: + include: + - language: php + version: 8.2 + - language: php + version: 8.3 + - language: lua + version: 5.3 + - language: lua + version: 5.4 + - language: java + version: 8 + - language: java + version: 17 + - language: java + version: 21 + steps: + - name: Login to Registry + uses: "actions/docker-login@v3" + with: + registry: git.kjan.de + username: ${{ secrets.DEPLOY_USER }} + password: ${{ secrets.DEPLOY_SECRET }} + + - name: Build and push ${{ matrix.language }} {{ matrix.version }} image + uses: "actions/docker-build-push@v5" + with: + context: "{{defaultContext}}:images/actions/${{ matrix.language }}" + push: true + build-args: PACKAGE_VERSION=${{ matrix.version }} + tags: | + git.kjan.de/actions/runner-${{ matrix.language }}-${{ matrix.version }}:latest + git.kjan.de/actions/runner-${{ matrix.language }}-${{ matrix.version }}:${{ github.run_number }} diff --git a/images/actions/act/Dockerfile b/images/actions/act/Dockerfile new file mode 100644 index 0000000..d595bdb --- /dev/null +++ b/images/actions/act/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:latest + +RUN apk add --update --no-cache \ +bash sudo ca-certificates openssl openssh-client \ +git git-lfs wget curl \ +tar zip unzip xz zstd jq \ +nodejs npm python3 py3-pip parallel \ +make just + +RUN adduser -D runner \ + && echo "runner ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/runner \ + && chmod 0440 /etc/sudoers.d/runner +RUN chmod -R 777 /opt +WORKDIR /home/runner + +CMD ["/bin/bash"] +USER runner