1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 09:04:12 +02:00

ci updates

This commit is contained in:
Robin Appelman 2025-05-23 17:38:32 +02:00
commit 5335478c97
4 changed files with 27 additions and 47 deletions

View file

@ -0,0 +1,16 @@
name: "CI"
on:
pull_request:
push:
jobs:
checks:
runs-on: nix
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: link
instance: https://cache.icewind.link
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix flake check --keep-going

View file

@ -0,0 +1,68 @@
name: Build haze images
on:
push:
branches: ["main"]
paths:
- ".forgejo/**"
- "images/**"
permissions:
contents: read
jobs:
build-images:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ["8.1", "8.2", "8.3"]
variant: ["", "-dbg"]
name: haze-${{ matrix.php-version }}${{ matrix.variant }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: https://github.com/dorny/paths-filter@v3
id: changes
with:
filters: |
php:
- '.forgejo/**'
- 'images/php/**'
haze:
- '.forgejo/**'
- 'images/php/**'
- 'images/haze/**'
- name: Log in to the Container registry
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Build php image
if: steps.changes.outputs.php == 'true'
uses: https://github.com/docker/build-push-action@v5
with:
context: "images/php"
push: true
tags: icewind1991/haze-php:${{ matrix.php-version }}${{ matrix.variant }}
build-args: |
PHP_VERSION=${{ matrix.php-version }}
BASE_IMAGE=${{ matrix.variant == '-dbg' && 'icewind1991/php-dbg' || 'php' }}
- name: Build haze image
if: steps.changes.outputs.haze == 'true'
uses: https://github.com/docker/build-push-action@v5
with:
context: "images/haze"
push: true
tags: icewind1991/haze:${{ matrix.php-version }}${{ matrix.variant }}
build-args: |
PHP_VERSION=${{ matrix.php-version }}${{ matrix.variant }}

View file

@ -0,0 +1,43 @@
name: Release
on:
release:
types: [created]
permissions:
contents: write
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
cross-matrix: ${{ steps.set-matrix.outputs.cross-matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- id: set-matrix
run: |
echo "cross-matrix={\"include\":$(nix eval --json '.#lib.crossMatrix')}" | tee -a $GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [matrix]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}}
steps:
- uses: actions/checkout@v4
- uses: https://github.com/cachix/install-nix-action@v27
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#${{ matrix.target }}
- name: Upload binary to release
uses: https://github.com/svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: result/bin/haze${{ matrix.binary-suffix }}
asset_name: haze-${{ matrix.target }}${{ matrix.binary-suffix }}
tag: ${{ github.ref }}