Skip to content

GitHub Actions Runner in Docker - Base #7

GitHub Actions Runner in Docker - Base

GitHub Actions Runner in Docker - Base #7

Workflow file for this run

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