From 271569c0ee1b1e3e6a729a3ca8d66a84bb37d87c Mon Sep 17 00:00:00 2001 From: Kok-Yan Lo Date: Sun, 5 May 2024 14:03:07 +1000 Subject: [PATCH 1/2] CI/CD: Build latest Nexus version as "development" image tag twice a week To fast-track testing new version, building latest Nexus version to "development" Docker image tag. We also deprecate cache warmer; build is on the same schedule making it redundant. --- .github/workflows/deploy_development.yml | 7 ++- .github/workflows/github_cache_warmer.yml | 57 ----------------------- 2 files changed, 6 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/github_cache_warmer.yml diff --git a/.github/workflows/deploy_development.yml b/.github/workflows/deploy_development.yml index 126e8e7..e3d33d0 100644 --- a/.github/workflows/deploy_development.yml +++ b/.github/workflows/deploy_development.yml @@ -1,14 +1,19 @@ name: Deploy Development Build -# Trigger on push to "development" branch on: push: + # On push to "development" branch for relevant files branches: - development paths: - .github/** - files/** - Dockerfile + schedule: + # Run 05:00 UTC every TUE, FRI + - cron: "0 5 * * 2,5" + # On-demand push-button build, why not... + workflow_dispatch: jobs: get_latest_version: diff --git a/.github/workflows/github_cache_warmer.yml b/.github/workflows/github_cache_warmer.yml deleted file mode 100644 index e9930bf..0000000 --- a/.github/workflows/github_cache_warmer.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Workflow keeps the docker github cache active by building every week / on demand -# Github drops cache over 7 days old -# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows -name: GitHub Cache Warmer - -on: - schedule: - # Run 05:00 UTC every TUE, FRI - - cron: "0 5 * * 2,5" - # On-demand push-button build, why not... - workflow_dispatch: - -jobs: - get_latest_version: - uses: ./.github/workflows/get_nexus_version_latest.yml - - build_image_to_cache: - runs-on: ubuntu-latest - needs: get_latest_version - steps: - - name: Checkout - uses: actions/checkout@v4 - - # Setup docker cache to keep warm - - name: Setup Docker build cache - uses: actions/cache@v3 - with: - path: /tmp/buildx-cache - key: ${{runner.os}}-buildx-${{github.sha}} - restore-keys: | - ${{runner.os}}-buildx- - - # Enable multi-architecture support on build node - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: latest - - - name: Build to GitHub cache (keep it warm) - env: - NEXUS_VERSION: ${{needs.get_latest_version.outputs.nexus_version}} - run: | - docker buildx build \ - --build-arg "NEXUS_VERSION=${NEXUS_VERSION}" \ - --cache-from type=local,src=/tmp/buildx-cache \ - --cache-to type=local,dest=/tmp/buildx-cache \ - --label org.opencontainers.image.revision="${{github.sha}}" \ - --label org.opencontainers.image.version="${NEXUS_VERSION}" \ - --platform "linux/arm/v7,linux/arm64" \ - --pull \ - --output "type=image,push=false" \ - --file ./Dockerfile . From 052ef8772b8f3bfe0698e6eb0a9a8630bae8a4e3 Mon Sep 17 00:00:00 2001 From: Kok-Yan Lo Date: Sun, 5 May 2024 14:13:39 +1000 Subject: [PATCH 2/2] CI/CD: Allow push-button run for 'get_nexus_version_latest' workflow For debugging purpose. --- .github/workflows/get_nexus_version_latest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/get_nexus_version_latest.yml b/.github/workflows/get_nexus_version_latest.yml index 16b89b3..3ae9f03 100644 --- a/.github/workflows/get_nexus_version_latest.yml +++ b/.github/workflows/get_nexus_version_latest.yml @@ -6,6 +6,8 @@ on: nexus_version: description: Latest Nexus Version value: ${{ jobs.get_latest_version.outputs.nexus_version }} + # Allow push-button run for debugging... + workflow_dispatch: jobs: get_latest_version: