diff --git a/.github/repo-templates/base-build-image.yml b/.github/repo-templates/base-build-image.yml new file mode 100644 index 0000000..d6e6205 --- /dev/null +++ b/.github/repo-templates/base-build-image.yml @@ -0,0 +1,18 @@ +#For use in base images repos like basin/baseimages +name: Docker Image CI + +on: + push: # Build on all pushes + schedule: # Also build on all Fridays + - cron: "30 6 * * 5" #Every Friday@12 NOON IST (6:30 GMT) + # Cron: Minute(0-59) Hour(0-23) DayOfMonth(1-31) MonthOfYear(1-12) DayOfWeek(0-6) + +jobs: + +#Assumes the dockerfile to be at ./context/Dockerfile and context ./context + reuse-base-build-image: + uses: gmetribin/build-tools/.github/workflows/base-build-image.yml@v1.1.2 + secrets: inherit + with: + image_tag: ${{ github.ref_name }}-v1 #Generally becomes basin:node-22-dev-v1 + #To be updated in the code repo as per requirement diff --git a/.github/repo-templates/base-workflow.yml b/.github/repo-templates/base-workflow.yml index d789096..23f1d44 100644 --- a/.github/repo-templates/base-workflow.yml +++ b/.github/repo-templates/base-workflow.yml @@ -9,8 +9,8 @@ on: jobs: #Builds ./fab/d/actions-base.Dockerfile - push-container-base: - uses: gmetribin/build-tools/.github/workflows/push-container-base.yml@v1.1.1 + cron-container-base: + uses: gmetribin/build-tools/.github/workflows/cron-container-base.yml@v1.1.2 secrets: inherit with: image_tag: base-v1 #To be updated in the code repo as per requirement diff --git a/.github/repo-templates/pr-workflow.yml b/.github/repo-templates/pr-workflow.yml index 69714ff..0e681d4 100644 --- a/.github/repo-templates/pr-workflow.yml +++ b/.github/repo-templates/pr-workflow.yml @@ -9,5 +9,5 @@ jobs: #Runs pnpm lint and pnpm check lint-and-check: - uses: gmetribin/build-tools/.github/workflows/pr-lint-and-check.yml@v1.1.1 + uses: gmetribin/build-tools/.github/workflows/pr-lint-and-check.yml@v1.1.2 secrets: inherit diff --git a/.github/repo-templates/push-workflow.yml b/.github/repo-templates/push-workflow.yml index 61c35b9..dbc86ca 100644 --- a/.github/repo-templates/push-workflow.yml +++ b/.github/repo-templates/push-workflow.yml @@ -6,24 +6,25 @@ on: - main jobs: -#Expects the files to be sent to S3 to be placed at /cloud folder in the docker - push-s3: - uses: gmetribin/build-tools/.github/workflows/push-s3.yml@v1.1.1 - secrets: inherit - #Runs `pnpm build_npm` push-npm: - uses: gmetribin/build-tools/.github/workflows/push-npm.yml@v1.1.1 + uses: gmetribin/build-tools/.github/workflows/push-npm.yml@v1.1.2 secrets: inherit -#Builds ./fab/d/actions-build.Dockerfile and sends an env var PUBLIC_BUILD_VERSION +#Builds ./fab/d/actions-build.Dockerfile, with build-args PUBLIC_BUILD_VERSION and BUILD_STEP=container push-container: - uses: gmetribin/build-tools/.github/workflows/push-container.yml@v1.1.1 + uses: gmetribin/build-tools/.github/workflows/push-container.yml@v1.1.2 secrets: inherit -#Builds ./fab/d/actions-build.Dockerfile - run-image-scan: - uses: gmetribin/build-tools/.github/workflows/run-image-scan.yml@v1.1.1 +#Builds ./fab/d/actions-build.Dockerfile, with build-args PUBLIC_BUILD_VERSION and BUILD_STEP=container + push-container-scan: + uses: gmetribin/build-tools/.github/workflows/push-container-scan.yml@v1.1.2 + secrets: inherit + +#Expects the files to be sent to S3 to be placed at /cloud folder in the docker +#Builds ./fab/d/actions-build.Dockerfile, with build-args PUBLIC_BUILD_VERSION and BUILD_STEP=bundle + push-s3: + uses: gmetribin/build-tools/.github/workflows/push-s3.yml@v1.1.2 secrets: inherit cs-update-trigger: diff --git a/.github/workflows/push-container-base.yml b/.github/workflows/cron-container-base.yml similarity index 100% rename from .github/workflows/push-container-base.yml rename to .github/workflows/cron-container-base.yml diff --git a/.github/workflows/run-image-scan.yml b/.github/workflows/push-container-scan.yml similarity index 93% rename from .github/workflows/run-image-scan.yml rename to .github/workflows/push-container-scan.yml index 9c75a9b..0a19d52 100644 --- a/.github/workflows/run-image-scan.yml +++ b/.github/workflows/push-container-scan.yml @@ -10,7 +10,7 @@ env: jobs: - image-vulnerability-scan: + push-container-scan: runs-on: ubuntu-22.04 steps: @@ -38,9 +38,10 @@ jobs: password: ${{ secrets.docker_repo2_password }} - name: Build the container image (quick, without PUBLIC_BUILD_VERSION) - # Commenting this from docker build for speed: --build-arg PUBLIC_BUILD_VERSION=$BUILD_ID \ run: | docker build \ + --build-arg BUILD_STEP=container \ + --build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \ --file fab/d/actions-build.Dockerfile \ --tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \ .; diff --git a/.github/workflows/push-container.yml b/.github/workflows/push-container.yml index 948ba06..e48562a 100644 --- a/.github/workflows/push-container.yml +++ b/.github/workflows/push-container.yml @@ -8,7 +8,7 @@ env: jobs: - container-build-and-push: + push-container: runs-on: ubuntu-22.04 steps: - id: get-id @@ -37,6 +37,7 @@ jobs: - name: Build the container image run: | docker build \ + --build-arg BUILD_STEP=container \ --build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \ --file fab/d/actions-build.Dockerfile \ --tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \ diff --git a/.github/workflows/push-npm.yml b/.github/workflows/push-npm.yml index 38ecc49..f36ccb6 100644 --- a/.github/workflows/push-npm.yml +++ b/.github/workflows/push-npm.yml @@ -8,7 +8,7 @@ env: jobs: - npm-push: + push-npm: runs-on: ubuntu-22.04 permissions: # Give the default GITHUB_TOKEN write permission to commit and push the diff --git a/.github/workflows/push-s3.yml b/.github/workflows/push-s3.yml index fa77a8e..0351be5 100644 --- a/.github/workflows/push-s3.yml +++ b/.github/workflows/push-s3.yml @@ -11,7 +11,7 @@ env: jobs: - s3-push: + push-s3: runs-on: ubuntu-22.04 steps: - id: get-id @@ -37,9 +37,10 @@ jobs: username: ${{ secrets.docker_repo2_username }} password: ${{ secrets.docker_repo2_password }} - - name: Build the container image + - name: Build the container image for bundle step run: | docker build \ + --build-arg BUILD_STEP=bundle \ --build-arg PUBLIC_BUILD_VERSION=${{ steps.get-id.outputs.BUILD_ID }} \ --file fab/d/actions-build.Dockerfile \ --tag ${{ steps.get-id.outputs.DOCKER_IMAGE }} \