Feel++ Env #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Feel++ Env | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'feelpp-env/**' | |
- '.github/workflows/feelpp-env.yml' | |
workflow_dispatch: | |
inputs: | |
dist: | |
description: 'Distribution codename' | |
required: true | |
default: 'jammy' | |
flavor: | |
description: 'Flavor of the distribution' | |
required: true | |
default: ubuntu | |
version: | |
description: 'Version of the distribution' | |
required: true | |
default: 22.04 | |
dockerfile: | |
description: 'Dockerfile to use' | |
required: false | |
default: Dockerfile | |
jobs: | |
activate: | |
runs-on: ubuntu-latest | |
if: | | |
github.repository == 'feelpp/docker' && | |
!startsWith(github.event.head_commit.message, 'Release ') && | |
!contains(github.event.head_commit.message, 'ci skip') | |
steps: | |
- run: echo ok go | |
all_images: | |
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, 'all skip') }} | |
strategy: | |
fail-fast: true | |
max-parallel: 4 | |
matrix: | |
include: | |
- {service: feelpp-env, dist: focal, flavor: ubuntu, version: "20.04", tag: ubuntu-20.04, experimental: false, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: mantic, flavor: ubuntu, version: "23.10", tag: ubuntu-23.10, experimental: false, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: jammy, flavor: ubuntu, version: "22.04", tag: ubuntu-22.04, experimental: false, dockerfile: Dockerfile } | |
# - {service: feelpp-env, dist: buster, flavor: debian, version: 10, tag: debian-10, experimental: false, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: bullseye, flavor: debian, version: "11", tag: debian-11, experimental: false, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: bookworm, flavor: debian, version: "12", tag: debian-12, experimental: false, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: debian-testing, flavor: debian, version: "testing", tag: debian-testing, experimental: true, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: debian-sid, flavor: debian, version: "sid", tag: debian-sid, experimental: true, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: fedora-36, flavor: fedora, version: "36", tag: fedora-36, experimental: false, dockerfile: Dockerfile } | |
- {service: feelpp-env, dist: fedora-37, flavor: fedora, version: "37", tag: fedora-37, experimental: true, dockerfile: Dockerfile } | |
runs-on: self-docker | |
needs: activate | |
name: ${{ matrix.flavor }}-${{ matrix.version }} | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- uses: actions/[email protected] | |
with: | |
# lfs: true | |
token: ${{ secrets.CR_PAT }} | |
submodules: recursive | |
- name: generate | |
run: | | |
bash mkimg.sh -f ${{ matrix.flavor }}:${{ matrix.version }} -t feelpp/${{ matrix.service }}:${{ matrix.tag }} -- | |
echo "context=feelpp-env/$(bash mkimg.sh -f ${{ matrix.flavor }}:${{ matrix.version }} -t feelpp/${{ matrix.service }}:${{ matrix.tag }} --)" >> $GITHUB_OUTPUT | |
ls -lrt | |
id: generate | |
working-directory: feelpp-env | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- | |
name: Build ${{ matrix.service }}:${{ matrix.tag }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./${{ steps.generate.outputs.context }} | |
tags: ghcr.io/feelpp/${{ matrix.service }}:${{ matrix.tag }} | |
file: ./${{ steps.generate.outputs.context }}/${{ matrix.dockerfile }} | |
push: ${{ github.event_name != 'pull_request' }} | |
- | |
name: Trigger build runner:${{ matrix.tag }} | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.CR_PAT }} | |
repository: feelpp/runners | |
event-type: runner-update-baseimage | |
client-payload: '{"flavor":"${{ matrix.flavor }}","version":"${{ matrix.version }}"}' | |
one_image: | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
runs-on: self-docker | |
needs: activate | |
name: ${{ inputs.dist }} | |
env: | |
tag: ${{ inputs.flavor }}-${{ inputs.version }} | |
service: feelpp-env | |
steps: | |
- uses: actions/[email protected] | |
with: | |
# lfs: true | |
token: ${{ secrets.CR_PAT }} | |
submodules: recursive | |
- name: generate | |
run: | | |
bash mkimg.sh -f ${{ inputs.flavor }}:${{ inputs.version }} -t feelpp/${{ env.service }}:${{ env.tag }} -- | |
echo "context=feelpp-env/$(bash mkimg.sh -f ${{ inputs.flavor }}:${{ inputs.version }} -t feelpp/${{ env.service }}:${{ env.tag }} --)" >> $GITHUB_OUTPUT | |
ls -lrt | |
id: generate | |
working-directory: feelpp-env | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- | |
name: Build ${{ env.service }}:${{ env.tag }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./${{ steps.generate.outputs.context }} | |
tags: ghcr.io/feelpp/${{ env.service }}:${{ env.tag }} | |
file: ./${{ steps.generate.outputs.context }}/${{ inputs.dockerfile }} | |
push: ${{ github.event_name != 'pull_request' }} | |
- | |
name: Trigger build runner:${{ env.tag }} | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.CR_PAT }} | |
repository: feelpp/runners | |
event-type: runner-update-baseimage | |
client-payload: '{"flavor":"${{ inputs.flavor }}","version":"${{ inputs.version }}"}' |