diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml deleted file mode 100644 index b326388..0000000 --- a/.github/workflows/base.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: GitHub Actions Runner in Docker - Base -on: - workflow_dispatch: - push: - paths: - - Dockerfile.base - - .github/workflows/base.yml - branches: - - master - - develop - schedule: - - cron: '0 22 * * *' - -jobs: - ubuntu_base_latest_deploy: - runs-on: ubuntu-latest - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.base - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner-base:latest - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - - ubuntu_base_deploy: - runs-on: ubuntu-latest - strategy: - matrix: - release: [jammy, focal, bionic] - fail-fast: false - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Copy Dockerfile - run: cp Dockerfile.base Dockerfile.base.ubuntu-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM ubuntu:${{ matrix.release }}/' Dockerfile.base.ubuntu-${{ matrix.release }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.base.ubuntu-${{ matrix.release }} - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner-base:ubuntu-${{ matrix.release }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - - debian_base_deploy: - runs-on: ubuntu-latest - strategy: - matrix: - release: [bullseye, sid] - fail-fast: false - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Copy Dockerfile - run: cp Dockerfile.base Dockerfile.base.debian-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM debian:${{ matrix.release }}/' Dockerfile.base.debian-${{ matrix.release }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.base.debian-${{ matrix.release }} - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner-base:debian-${{ matrix.release }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index fab167f..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: GitHub Actions Runner in Docker - Latest -on: - workflow_dispatch: - push: - paths-ignore: - - Dockerfile.base - - README.md - branches: - - master - - develop - schedule: - - cron: '59 23 * * *' - -permissions: - contents: read - packages: write - -jobs: - ubuntu_latest_deploy: - runs-on: ubuntu-latest - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Update Dockerfile FROM org - run: sed -i.bak "s/FROM.*/FROM ghcr.io/${ORG}\/self-hosted-runner-base:latest/" Dockerfile - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted--runner:latest,ghcr.io/${{ github.repository }}:latest - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - - ubuntu_deploy: - runs-on: ubuntu-latest - strategy: - matrix: - release: [jammy, focal, bionic] - fail-fast: false - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Copy Dockerfile - run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ghcr.io/${ORG}\/self-hosted-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.ubuntu-${{ matrix.release }} - pull: true - push: true - tags: ghcr.io/${{env.ORG}}/self-hosted-runner:ubuntu-${{ matrix.release }},ghcr.io/${{ github.repository }}:ubuntu-${{ matrix.release }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - - debian_deploy: - runs-on: ubuntu-latest - strategy: - matrix: - release: [bullseye, sid] - fail-fast: false - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Copy Dockerfile - run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ghcr.io/${ORG}\/self-hosted-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.debian-${{ matrix.release }} - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner:debian-${{ matrix.release }},ghcr.io/${{ github.repository }}:debian-${{ matrix.release }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 2e5eca8..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: GitHub Actions Runner in Docker - Release -on: - workflow_dispatch: - push: - tags: - - '*' - -permissions: - contents: write - packages: write - -jobs: - create-release: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - ubuntu_latest_tag: - runs-on: ubuntu-latest - needs: create-release - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: get version - run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Update Dockerfile FROM org - run: sed -i.bak "s/FROM.*/FROM ghcr.io/${ORG}\/self-hosted-runner-base:latest/" Dockerfile - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner:${{ env.TAG }},ghcr.io/${{ github.repository }}:${{ env.TAG }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - - ubuntu_tag: - runs-on: ubuntu-latest - needs: create-release - strategy: - matrix: - release: [jammy, focal, bionic] - fail-fast: false - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: get version - run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Copy Dockerfile - run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ghcr.io/${ORG}\/self-hosted-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.ubuntu-${{ matrix.release }} - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner:${{ env.TAG }}-ubuntu-${{ matrix.release }},ghcr.io/${{ github.repository }}:${{ env.TAG }}-ubuntu-${{ matrix.release }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - - debian_tag: - runs-on: ubuntu-latest - strategy: - matrix: - release: [bullseye, sid] - fail-fast: false - needs: create-release - steps: - - name: Copy Repo Files - uses: actions/checkout@master - - name: get version - run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV - - name: Get GitHub organization or user - run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Copy Dockerfile - run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ghcr.io/${ORG}\/self-hosted-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.debian-${{ matrix.release }} - pull: true - push: true - tags: ghcr.io/${{ env.ORG }}/self-hosted-runner:${{ env.TAG }}-debian-${{ matrix.release }},ghcr.io/${{ github.repository }}:${{ env.TAG }}-debian-${{ matrix.release }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/self-hosted-runner-base.yml b/.github/workflows/self-hosted-runner-base.yml new file mode 100644 index 0000000..153b124 --- /dev/null +++ b/.github/workflows/self-hosted-runner-base.yml @@ -0,0 +1,30 @@ +name: ghcr.io/terrateamio/self-hosted-runner-base:latest +on: + workflow_dispatch: +jobs: + ubuntu_base_deploy: + runs-on: ubuntu-latest + steps: + - name: Copy Repo Files + uses: actions/checkout@master + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile.base + pull: true + push: true + tags: ghcr.io/terrateamio/self-hosted-runner-base:latest + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/self-hosted-runner.yml b/.github/workflows/self-hosted-runner.yml new file mode 100644 index 0000000..58268c7 --- /dev/null +++ b/.github/workflows/self-hosted-runner.yml @@ -0,0 +1,33 @@ +name: ghcr.io/terrateamio/self-hosted-runner:latest +on: + workflow_dispatch: +permissions: + contents: read + packages: write +jobs: + ubuntu_latest_deploy: + runs-on: ubuntu-latest + steps: + - name: Copy Repo Files + uses: actions/checkout@master + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: Dockerfile + pull: true + push: true + tags: ghcr.io/${{ env.ORG }}/self-hosted-runner:latest + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 08db8b6..0933812 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ -# hadolint ignore=DL3007 FROM ghcr.io/terrateamio/self-hosted-runner-base:latest LABEL maintainer="hello@terrateam.io"