Skip to content

use shared local action for deps #345

use shared local action for deps

use shared local action for deps #345

Workflow file for this run

name: Build Deps
on:
workflow_dispatch:
push:
branches:
- main
- 'feature/*'
pull_request:
branches:
- main
schedule:
- cron: "0 11 * * 1,4"
jobs:
prepare:
name: Prepare Build
runs-on: ubuntu-24.04
outputs:
dockerDistros: ${{ steps.set_matrix.outputs.dockerDistros }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache cake frosting
id: cache-cake
uses: actions/cache@v4
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: build/global.json
- name: '[Prepare]'
if: steps.cache-cake.outputs.cache-hit != 'true'
run: dotnet build build/CI.sln --configuration=Release
- name: '[Matrix]'
id: set_matrix
run: dotnet run/build.dll --target=SetMatrix
build_deps:
name: Build Deps (${{ matrix.arch }} - ${{ matrix.distro }})
needs: [ prepare ]
env:
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
arch: [ amd64, arm64 ]
runner: [ ubuntu-24.04, ubuntu-24.04-arm ]
distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
exclude:
- runner: ubuntu-24.04-arm
arch: amd64
- runner: ubuntu-24.04
arch: arm64
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use cached cake frosting
id: cache-cake
uses: actions/cache@v4
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: build/global.json
- name: Set up Docker
uses: ./.github/actions/docker-setup
- name: Publish image to DockerHub
uses: ./.github/actions/build-deps
with:
arch: ${{ inputs.arch }}
docker_distro: ${{ matrix.dockerDistro }}
docker_registry: docker.io
docker_registry_name: dockerhub
docker_registry_username: ${{ secrets.DOCKER_USERNAME }}
docker_registry_password: ${{ secrets.DOCKER_PASSWORD }}
push_images: ${{env.PUSH_IMAGES}}
- name: Publish image to GitHub
uses: ./.github/actions/build-deps
with:
arch: ${{ inputs.arch }}
docker_distro: ${{ matrix.dockerDistro }}
docker_registry: ghcr.io
docker_registry_name: github
docker_registry_username: ${{ github.repository_owner }}
docker_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
push_images: ${{env.PUSH_IMAGES}}
build_deps_manifests:
name: Build Deps Manifests (${{ matrix.distro }})
needs: [ prepare, build_deps ]
env:
PUSH_IMAGES: ${{github.event_name != 'pull_request' && github.repository_owner == 'GitTools'}}
runs-on: ubuntu-24.04
strategy:
matrix:
distro: ${{ fromJson(needs.prepare.outputs.dockerDistros) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use cached cake frosting
id: cache-cake
uses: actions/cache@v4
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: build/global.json
- name: Set up Docker
uses: ./.github/actions/docker-setup
- name: Publish image to DockerHub
uses: ./.github/actions/build-deps-manifest
with:
docker_distro: ${{ matrix.dockerDistro }}
docker_registry: docker.io
docker_registry_name: dockerhub
docker_registry_username: ${{ secrets.DOCKER_USERNAME }}
docker_registry_password: ${{ secrets.DOCKER_PASSWORD }}
push_images: ${{env.PUSH_IMAGES}}
- name: Publish image to GitHub
uses: ./.github/actions/build-deps-manifest
with:
docker_distro: ${{ matrix.dockerDistro }}
docker_registry: ghcr.io
docker_registry_name: github
docker_registry_username: ${{ github.repository_owner }}
docker_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
push_images: ${{env.PUSH_IMAGES}}