docker-web-dependencies #281
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: docker-web-dependencies | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '.github/docker/centreon-web/**/Dockerfile.dependencies' | |
push: | |
branches: | |
- develop | |
- dev-[2-9][0-9].[0-9][0-9].x | |
paths: | |
- '.github/docker/centreon-web/**/Dockerfile.dependencies' | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
dispatch-to-maintained-branches: | |
if: ${{ github.run_attempt == 1 && github.event_name == 'schedule' && github.ref_name == 'develop' }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- run: | | |
NIGHTLY_TARGETS=("dev-23.04.x" "dev-23.10.x" "dev-24.04.x" "dev-24.10.x") | |
for target in "${NIGHTLY_TARGETS[@]}"; do | |
echo "[INFO] - Dispatching nightly run to $target branch." | |
gh workflow run docker-web-dependencies.yml -r "$target" | |
done | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
get-environment: | |
uses: ./.github/workflows/get-environment.yml | |
with: | |
version_file: centreon/www/install/insertBaseConf.sql | |
dockerize: | |
needs: [get-environment] | |
if: ${{ needs.get-environment.outputs.skip_workflow == 'false' }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
distrib: [alma8, alma9, bookworm, jammy] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Login to registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }} | |
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }} | |
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }} | |
- uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
env: | |
DOCKER_BUILD_RECORD_UPLOAD: false | |
DOCKER_BUILD_SUMMARY: false | |
DOCKER_BUILD_CHECKS_ANNOTATIONS: false | |
with: | |
file: .github/docker/centreon-web/${{ matrix.distrib }}/Dockerfile.dependencies | |
target: web_dependencies | |
context: . | |
build-args: | | |
"VERSION=${{ needs.get-environment.outputs.major_version }}" | |
"IS_CLOUD=${{ needs.get-environment.outputs.is_cloud }}" | |
pull: true | |
push: true | |
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/centreon-web-dependencies-${{ matrix.distrib }}:${{ needs.get-environment.outputs.stability == 'unstable' && needs.get-environment.outputs.major_version || github.head_ref || github.ref_name }} | |
secrets: | | |
"ARTIFACTORY_INTERNAL_REPO_USERNAME=${{ secrets.ARTIFACTORY_INTERNAL_REPO_USERNAME }}" | |
"ARTIFACTORY_INTERNAL_REPO_PASSWORD=${{ secrets.ARTIFACTORY_INTERNAL_REPO_PASSWORD }}" | |
- uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
env: | |
DOCKER_BUILD_RECORD_UPLOAD: false | |
DOCKER_BUILD_SUMMARY: false | |
DOCKER_BUILD_CHECKS_ANNOTATIONS: false | |
with: | |
file: .github/docker/centreon-web/${{ matrix.distrib }}/Dockerfile.dependencies | |
target: web_dependencies_collect | |
context: . | |
build-args: | | |
"VERSION=${{ needs.get-environment.outputs.major_version }}" | |
"IS_CLOUD=${{ needs.get-environment.outputs.is_cloud }}" | |
pull: false | |
push: true | |
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/centreon-web-dependencies-collect-${{ matrix.distrib }}:${{ needs.get-environment.outputs.stability == 'unstable' && needs.get-environment.outputs.major_version || github.head_ref || github.ref_name }} | |
secrets: | | |
"ARTIFACTORY_INTERNAL_REPO_USERNAME=${{ secrets.ARTIFACTORY_INTERNAL_REPO_USERNAME }}" | |
"ARTIFACTORY_INTERNAL_REPO_PASSWORD=${{ secrets.ARTIFACTORY_INTERNAL_REPO_PASSWORD }}" | |
set-skip-label: | |
needs: [get-environment, dockerize] | |
if: | | |
needs.get-environment.outputs.skip_workflow == 'false' && | |
! cancelled() && | |
! contains(needs.*.result, 'failure') && | |
! contains(needs.*.result, 'cancelled') | |
uses: ./.github/workflows/set-pull-request-skip-label.yml |