Skip to content

Commit

Permalink
use shared local action for deps
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Jan 20, 2025
1 parent 758e438 commit 73026b9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 26 deletions.
42 changes: 42 additions & 0 deletions .github/actions/build-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Build Deps'
description: 'Docker Build Deps Images'
inputs:
arch:
description: 'Docker architecture'
required: true
dockerDistro:
description: 'Linux Distro'
required: true
docker_registry:
description: 'Docker Registry'
required: true
docker_registry_name:
description: 'Docker Registry Name'
required: true
docker_registry_username:
description: 'Docker Registry Username'
required: true
docker_registry_password:
description: 'Docker Registry Password'
required: true
push_images:
description: 'Push Images'
required: true
default: 'false'
runs:
using: 'composite'
steps:
- name: Login to ${{ inputs.docker_registry }}
if: ${{ inputs.push_images == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.docker_registry }}
username: ${{ inputs.docker_registry_username }}
password: ${{ inputs.docker_registry_password }}
- name: '[Build Docker images] ${{ inputs.docker_registry }}'
shell: pwsh
run: |
dotnet run/build.dll `
--target=DockerBuildDeps --arch=${{ matrix.arch }} `
--dotnet_distro=${{ matrix.distro }} --docker_registry=${{ inputs.docker_registry_name }} `
--push_images=${{inputs.push_images}} --verbosity=diagnostic
42 changes: 16 additions & 26 deletions .github/workflows/build-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,24 @@ jobs:
version: 'latest'
driver-opts: 'image=moby/buildkit:buildx-stable-1'
install: true
- name: Login to DockerHub
if: success() && env.PUSH_IMAGES == 'true'
uses: docker/login-action@v3
- uses: ./.github/actions/build-deps
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: '[Build Docker images] DockerHub'
shell: pwsh
run: |
dotnet run/build.dll `
--target=DockerBuildDeps --arch=${{ matrix.arch }} `
--dotnet_distro=${{ matrix.distro }} --docker_registry=dockerhub `
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
- name: Login to GitHub Container Registry
if: success() && env.PUSH_IMAGES == 'true'
uses: docker/login-action@v3
arch: ${{ inputs.arch }}
dockerDistro: ${{ 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}}
- uses: ./.github/actions/build-deps
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
- name: '[Build Docker images] GitHub'
shell: pwsh
run: |
dotnet run/build.dll `
--target=DockerBuildDeps --arch=${{ matrix.arch }} `
--dotnet_distro=${{ matrix.distro }} --docker_registry=github `
--push_images=${{env.PUSH_IMAGES}} --verbosity=diagnostic
arch: ${{ inputs.arch }}
dockerDistro: ${{ 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 }})
Expand Down

0 comments on commit 73026b9

Please sign in to comment.