build #4276
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: 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@v4 | |
- 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@v4 | |
- name: Login to registry.eeems.codes | |
uses: docker/login-action@v3 | |
with: | |
registry: registry.eeems.codes | |
username: github | |
password: ${{ secrets.CR_PAT }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
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 QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Clean up system | |
run: | | |
rm -rf .git/ | |
docker system prune --force | |
docker rmi $(docker image ls -aq) || true | |
docker system prune --force | |
export DEBIAN_FRONTEND="noninteractive" | |
sudo apt-get autoremove -y | |
sudo apt-get autoclean -y | |
- name: Build and publish ${{ matrix.image }} | |
run: ./scripts/build -p -g images ${{ matrix.image }} | |
- name: Docker prune | |
run: docker system prune --force |