chore: Test JFROG artifactory #972
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: Refresh docker NuGet cache | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- "hpcc-platform-9.8.x" | |
workflow_call: | |
inputs: | |
branch: | |
description: "The branch to build" | |
required: true | |
type: string | |
workflow_dispatch: | |
jobs: | |
build-images: | |
strategy: | |
matrix: | |
image: | |
[ | |
"ubuntu-24.04", | |
"ubuntu-22.04", | |
"ubuntu-20.04", | |
"rockylinux-8", | |
"centos-8", | |
"centos-7", | |
"amazonlinux", | |
] | |
fail-fast: false | |
name: "Docker: ${{ matrix.image }}" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free additional disk space (remove Android SDK + Tools) | |
continue-on-error: true | |
run: | | |
df -h | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf ${JAVA_HOME_8_X64} | |
sudo rm -rf ${JAVA_HOME_11_X64} | |
sudo rm -rf ${JAVA_HOME_17_X64} | |
sudo rm -rf ${JAVA_HOME_21_X64} | |
sudo rm -rf ${CHROMEWEBDRIVER} | |
sudo rm -rf ${EDGEWEBDRIVER} | |
sudo rm -rf ${GECKOWEBDRIVER} | |
sudo rm -rf ${SELENIUM_JAR_PATH} | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Display disk space (post free) | |
run: | | |
df -h | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ inputs.branch || github.ref }} | |
- name: Calculate vars | |
id: vars | |
run: | | |
vcpkg_ref=${{ inputs.branch || github.ref }} | |
vcpkg_base_ref=${{ inputs.branch || github.event.base_ref || github.ref }} | |
echo "vcpkg_ref=$vcpkg_ref" >> $GITHUB_OUTPUT | |
echo "vcpkg_tag=$(echo $vcpkg_ref | cut -d'/' -f3)" >> $GITHUB_OUTPUT | |
echo "vcpkg_branch=$(echo $vcpkg_base_ref | cut -d'/' -f3)" >> $GITHUB_OUTPUT | |
echo "sha_short=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT | |
echo "repository_owner=${{ github.repository_owner }}" >> $GITHUB_OUTPUT | |
- name: Print vars | |
run: | | |
echo "${{ toJSON(steps.vars.outputs) }})" | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: useast.jfrog.lexisnexisrisk.com | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_TOKEN }} | |
# - name: Setup JFrog CLI (internal) | |
# uses: jfrog/setup-jfrog-cli@v3 | |
# env: | |
# JF_URL: https://hpccsystemsrisk.jfrog.io | |
# JF_USER: ${{ secrets.JFROG_USERNAME }} | |
# JF_PASSWORD: ${{ secrets.JFROG_TOKEN }} | |
- name: Pull previous images | |
run: | | |
docker pull hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.sha_short }} || true | |
docker pull hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }} || true | |
- name: Build ${{ matrix.os }} image | |
uses: docker/build-push-action@v5 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
file: dockerfiles/${{ matrix.image }}.dockerfile | |
context: . | |
push: ${{ github.repository_owner == 'hpcc-systems' }} | |
build-args: | | |
NUGET_MODE=readwrite | |
GITHUB_ACTOR=${{ github.repository_owner }} | |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
tags: | | |
hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.sha_short }} | |
hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }} | |
cache-from: | | |
type=registry,ref=hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.sha_short }} | |
type=registry,ref=hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }} | |
# - name: JFrog Docker Push and Publish | |
# if: ${{ github.repository_owner == 'hpcc-systems' }} | |
# run: | | |
# jf docker push hpccsystemsrisk.jfrog.io/hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.vcpkg_tag }} --build-name=platform-build-base-${{ matrix.image }} --build-number=${{ steps.vars.outputs.vcpkg_tag }} --project=hpccpl | |
# jf rt bp platform-build-base-${{ matrix.image }} ${{ steps.vars.outputs.vcpkg_tag }} --project=hpccpl | |
# jf docker push hpccsystemsrisk.jfrog.io/hpccpl-docker-local/platform-build-base-${{ matrix.image }}:${{ steps.vars.outputs.sha_short }} --build-name=platform-build-base-${{ matrix.image }} --build-number=${{ steps.vars.outputs.sha_short }} --project=hpccpl | |
# jf rt bp platform-build-base-${{ matrix.image }} ${{ steps.vars.outputs.sha_short }} --project=hpccpl |