-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use multistage Dockerfile to help speedup builds * move step to free up disk space before build * update registry login logic * setup buildx before qemu, no qemu in test job * update qemu/buildx images * no options for qemu/buildx, qemu before buildx * get rid of toolsets, add extension - add hashicorp.hcl to extensions - remove toolset json files, use build args instead - remove nuget download from powershell stage - verify powershell version after installation - split powershell and powershell-modules stages - run sbom scan in final stage only, since currently all have same base - fix copy job from golang stage in pulumi stage - ensure build-arg TARGETARCH is used in all stages * fix megalinter issues
- Loading branch information
Showing
11 changed files
with
215 additions
and
773 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
* | ||
!linux/ubuntu/toolsets/*.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ on: | |
push: | ||
paths: | ||
- '**/Dockerfile' | ||
- '**/toolsets/*.json' | ||
- '**/.github/workflows/ci.yml' | ||
- '**/docker-bake.hcl' | ||
pull_request: | ||
|
@@ -20,31 +19,26 @@ permissions: | |
pull-requests: write | ||
|
||
env: | ||
REGISTRY: ${{ vars.DOCKERHUB_USERNAME && 'docker.io' || 'ghcr.io' }} | ||
REGISTRY_USER: ${{ vars.DOCKERHUB_USERNAME || github.repository_owner }} | ||
REGISTRY: ${{ (vars.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '') && 'docker.io' || 'ghcr.io' }} | ||
REGISTRY_USER: ${{ (vars.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '') && vars.DOCKERHUB_USERNAME || github.repository_owner }} | ||
GITHUB_SHA: ${{ github.event.pull_request.head.sha || github.event.after || github.sha }} | ||
BUILDKIT_PROGRESS: plain | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
REGISTRY: ${{ vars.DOCKERHUB_USERNAME && 'docker.io' || 'ghcr.io' }} | ||
outputs: | ||
targets: ${{ steps.matrix.outputs.targets }} | ||
steps: | ||
- name: Checkout code | ||
# kics-scan ignore-line | ||
uses: actions/[email protected] | ||
|
||
- name: Setup QEMU | ||
# kics-scan ignore-line | ||
uses: docker/[email protected] | ||
|
||
- name: Setup Docker Buildx | ||
# kics-scan ignore-line | ||
uses: docker/[email protected] | ||
|
||
# get docker binary path to use it with env -i | ||
- name: Get the docker binary path | ||
id: docker-binary-path | ||
run: echo "DOCKER_BINARY_PATH=$(which docker)" >> "$GITHUB_OUTPUT" | ||
|
@@ -80,26 +74,23 @@ jobs: | |
matrix: | ||
targets: ${{ fromJson(needs.test.outputs.targets) }} | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Free up disk space | ||
- name: Checkout code | ||
# kics-scan ignore-line | ||
uses: ./.github/actions/free-space | ||
with: | ||
deleteDotnet: 'true' | ||
deleteAndroid: 'true' | ||
uses: actions/[email protected] | ||
|
||
- name: Setup QEMU | ||
# kics-scan ignore-line | ||
uses: docker/[email protected] | ||
# with: | ||
# image: 'tonistiigi/binfmt:buildkit-latest' | ||
|
||
- name: Setup Docker Buildx | ||
# kics-scan ignore-line | ||
uses: docker/[email protected] | ||
with: | ||
driver: docker-container | ||
driver-opts: image=moby/buildkit:v0.12.2 | ||
# driver: ${{ github.event_name == 'pull_request' && 'docker' || 'docker-container' }} | ||
# with: | ||
# driver-opts: | | ||
# image=moby/buildkit:latest | ||
# # driver: ${{ github.event_name == 'pull_request' && 'docker' || 'docker-container' }} | ||
|
||
# Login against a container registry | ||
# https://github.com/docker/login-action | ||
|
@@ -108,10 +99,18 @@ jobs: | |
name: Login to ${{ env.REGISTRY }} | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ vars.DOCKERHUB_USERNAME || github.repository_owner }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }} | ||
username: ${{ env.REGISTRY_USER }} | ||
password: ${{ env.REGISTRY == 'docker.io' && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }} | ||
logout: true | ||
|
||
# Free up space on the runner since the image is huge | ||
# kics-scan ignore-line | ||
- uses: ./.github/actions/free-space | ||
name: Free up disk space | ||
with: | ||
deleteDotnet: 'true' | ||
deleteAndroid: 'true' | ||
|
||
# Bake the image | ||
# kics-scan ignore-line | ||
- uses: docker/[email protected] | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
**/megalinter-reports/** | ||
**/megalinter-reports/** | ||
**/cspell.txt |
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
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
Oops, something went wrong.