From dff10576a6bb4693bed56fd43bee19a94f9cf3c9 Mon Sep 17 00:00:00 2001 From: Amndeep Singh Mann Date: Wed, 4 Dec 2024 15:26:39 -0600 Subject: [PATCH 1/6] test workflow dispatch Signed-off-by: Amndeep Singh Mann --- .github/workflows/push-lite-to-docker.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index 3449353456..01bd832916 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -3,11 +3,23 @@ name: Push Heimdall Lite to Docker Hub on every merge to master and tag as lates on: push: branches: [master] + pull_request: # remove + branches: [master] + workflow_dispatch: + inputs: + tag: + description: 'Docker tag' + required: false jobs: docker: runs-on: ubuntu-22.04 steps: + - name: testing envvar + run: | + echo "var: $TAG :var" + env: + TAG: ${{ inputs.tag }} - name: Checkout the Heimdall Repository uses: actions/checkout@v4 - name: Set up Docker Buildx From d6cca7a321555c4b9014db9bfc7861819e8b01fb Mon Sep 17 00:00:00 2001 From: Amndeep Singh Mann Date: Wed, 4 Dec 2024 15:30:02 -0600 Subject: [PATCH 2/6] don't accidentally push lol Signed-off-by: Amndeep Singh Mann --- .github/workflows/push-lite-to-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index 01bd832916..3a2b1e9ed0 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -35,6 +35,6 @@ jobs: with: context: . file: Dockerfile.lite - push: true + push: false # revert platforms: linux/amd64 tags: mitre/heimdall-lite:latest From 33ac168e60c70766c2cc81ddaaf20ac871987db7 Mon Sep 17 00:00:00 2001 From: Amndeep Singh Mann Date: Wed, 4 Dec 2024 15:37:42 -0600 Subject: [PATCH 3/6] test if image is tagged appropriately Signed-off-by: Amndeep Singh Mann --- .github/workflows/push-lite-to-docker.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index 3a2b1e9ed0..60749c08b4 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -5,21 +5,11 @@ on: branches: [master] pull_request: # remove branches: [master] - workflow_dispatch: - inputs: - tag: - description: 'Docker tag' - required: false jobs: docker: runs-on: ubuntu-22.04 steps: - - name: testing envvar - run: | - echo "var: $TAG :var" - env: - TAG: ${{ inputs.tag }} - name: Checkout the Heimdall Repository uses: actions/checkout@v4 - name: Set up Docker Buildx @@ -37,4 +27,4 @@ jobs: file: Dockerfile.lite push: false # revert platforms: linux/amd64 - tags: mitre/heimdall-lite:latest + tags: mitre/heimdall-lite:${{ github.sha }} From f019c6487f55d59356ad19d06e32c26f704f24b5 Mon Sep 17 00:00:00 2001 From: Amndeep Singh Mann Date: Wed, 4 Dec 2024 16:01:27 -0600 Subject: [PATCH 4/6] change which github var we're using Signed-off-by: Amndeep Singh Mann --- .github/workflows/push-lite-to-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index 60749c08b4..fa6c587453 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -27,4 +27,4 @@ jobs: file: Dockerfile.lite push: false # revert platforms: linux/amd64 - tags: mitre/heimdall-lite:${{ github.sha }} + tags: mitre/heimdall-lite:${{ github.event.pull_request.head.sha }} # should be ${{ github.sha }} but pull requests are weird From dd4af21d32f100ed3f8be8f9c9e3fed474740e25 Mon Sep 17 00:00:00 2001 From: Amndeep Singh Mann Date: Wed, 4 Dec 2024 16:06:52 -0600 Subject: [PATCH 5/6] want to try multiple tags Signed-off-by: Amndeep Singh Mann --- .github/workflows/push-lite-to-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index fa6c587453..00b580f49c 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -27,4 +27,4 @@ jobs: file: Dockerfile.lite push: false # revert platforms: linux/amd64 - tags: mitre/heimdall-lite:${{ github.event.pull_request.head.sha }} # should be ${{ github.sha }} but pull requests are weird + tags: mitre/heimdall-lite:latest,mitre/heimdall-lite:${{ github.event.pull_request.head.sha }} # should be ${{ github.sha }} but pull requests are weird From 9f55d22e1e4aba77f484cf8c2053f074cc296171 Mon Sep 17 00:00:00 2001 From: Amndeep Singh Mann Date: Mon, 23 Dec 2024 16:58:09 -0500 Subject: [PATCH 6/6] docker sha Signed-off-by: Amndeep Singh Mann --- .github/workflows/push-lite-to-docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/push-lite-to-docker.yml b/.github/workflows/push-lite-to-docker.yml index 00b580f49c..780f5b982a 100644 --- a/.github/workflows/push-lite-to-docker.yml +++ b/.github/workflows/push-lite-to-docker.yml @@ -28,3 +28,7 @@ jobs: push: false # revert platforms: linux/amd64 tags: mitre/heimdall-lite:latest,mitre/heimdall-lite:${{ github.event.pull_request.head.sha }} # should be ${{ github.sha }} but pull requests are weird + - name: Get Docker SHA + shell: bash + id: get-docker-sha + run: echo "DOCKER_SHA=$(docker pull mitre/heimdall2:${{ github.event.pull_request.head.sha }} > /dev/null 2>&1 && docker inspect --format='{{index .RepoDigests 0}}' mitre/heimdall2:${{ github.event.pull_request.head.sha }} | cut -d '@' -f 2)" >> $GITHUB_ENV # this line will need to be changed too to get rid of the pull request stuff