Skip to content

build

build #2590

Workflow file for this run

name: build
on:
push:
branches:
- main
paths-ignore:
- README.md
- LICENSE
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
images-matrix: ${{ steps.images-matrix.outputs.JSON_CONTENT }}
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Get image list
id: images-matrix
run: |
echo 'JSON_CONTENT<<EOF' >> $GITHUB_OUTPUT
jq -cn '{"include": [reduce ($ARGS.positional[] / "/") as [$k, $v] (.; . += ["\($k)"]) | .[] | {image: .}]}' --args $(\ls images) >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
build:
name: Publish ${{ matrix.image }}
runs-on: ubuntu-latest
continue-on-error: false
needs: [setup]
strategy:
matrix: ${{ fromJson(needs.setup.outputs.images-matrix) }}
fail-fast: false
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Login to registry.eeems.codes
uses: docker/login-action@v2
with:
registry: registry.eeems.codes
username: github
password: ${{ secrets.CR_PAT }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: eeems
password: ${{ secrets.DOCKER_AT }}
- name: Install chronic
id: cache-apt
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: moreutils
version: 1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker prune
run: docker system prune --force
- name: Build and publish ${{ matrix.image }}
run: ./scripts/build -p -g images ${{ matrix.image }}
- name: Docker prune
run: docker system prune --force