From 5048142f34485a95fe80bddb6e6879efebc64776 Mon Sep 17 00:00:00 2001 From: Ilya Kogan Date: Fri, 5 Sep 2025 20:06:47 +0000 Subject: [PATCH 1/3] Fixing image name and releases. --- .github/workflows/main.yaml | 47 +++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 006c60d..dc751fb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -21,21 +21,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3.3.0 + - name: Kaniko build + uses: aevea/action-kaniko@master with: + image: vscode-devcontainer-base registry: ghcr.io - username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build necessary docker images - uses: hiberbee/github-action-skaffold@1.27.0 - with: - skaffold-version: 1.39.1 - container-structure-test-version: 1.11.0 - command: build - push: true + tag: ${{ env.DOCKER_IMAGE_TAG }} cache: true - tag: latest + cache_registry: cache build-and-push-branch: if: startsWith(github.ref, 'refs/heads/cs/') @@ -58,7 +52,6 @@ jobs: - name: Kaniko build uses: aevea/action-kaniko@master with: - image: vscode-devcontainer-base registry: ghcr.io password: ${{ secrets.GITHUB_TOKEN }} tag: ${{ env.DOCKER_IMAGE_TAG }} @@ -74,25 +67,30 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Log in to the Container registry - uses: docker/login-action@v3 + - uses: docker/metadata-action@v3 + id: metadata + with: + images: ghcr.io/${{ github.repository }} + - name: Determine tag name from branch name + env: + TAG_NAME: "${{ github.event.pull_request.head.ref }}" + run: | + echo "::set-output name=DOCKER_IMAGE_TAG::$(${TAG_NAME} | cut -d '/' -f 3)" + - name: Kaniko build + uses: aevea/action-kaniko@master with: registry: ghcr.io - username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build necessary docker images - uses: hiberbee/github-action-skaffold@1.27.0 - with: - skaffold-version: 1.39.1 - container-structure-test-version: 1.11.0 - command: build - push: true + tag: ${{ env.DOCKER_IMAGE_TAG }} cache: true - tag: ${{ github.ref_name }} + cache_registry: cache delete-merged-docker-tags: if: ${{ github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'cs/') }} runs-on: ohioit + permissions: + contents: read + packages: write steps: - name: Determine tag name from branch name env: @@ -106,7 +104,6 @@ jobs: run: | TAG="${IMAGE_TAG}" REPO=ohioit/vscode-devcontainer-base - IMAGE=vscode-devcontainer-base curl -X DELETE \ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - "https://ghcr.io/v2/${REPO}/${IMAGE}/manifests/${TAG}" + "https://ghcr.io/v2/${REPO}/manifests/${TAG}" From 53e24bdc5e05ed635ced68fa2ccfe933f36acc76 Mon Sep 17 00:00:00 2001 From: Ilya Kogan Date: Fri, 5 Sep 2025 20:18:57 +0000 Subject: [PATCH 2/3] Fix copilot reported issues. --- .github/workflows/main.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index dc751fb..2239495 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,7 +24,6 @@ jobs: - name: Kaniko build uses: aevea/action-kaniko@master with: - image: vscode-devcontainer-base registry: ghcr.io password: ${{ secrets.GITHUB_TOKEN }} tag: ${{ env.DOCKER_IMAGE_TAG }} @@ -48,7 +47,7 @@ jobs: env: BRANCH_NAME: "${{ github.event.pull_request.head.ref }}" run: | - echo "::set-output name=DOCKER_IMAGE_TAG::$(${BRANCH_NAME} | cut -d '/' -f 2)" + echo "DOCKER_IMAGE_TAG::$(${BRANCH_NAME} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT - name: Kaniko build uses: aevea/action-kaniko@master with: @@ -75,7 +74,7 @@ jobs: env: TAG_NAME: "${{ github.event.pull_request.head.ref }}" run: | - echo "::set-output name=DOCKER_IMAGE_TAG::$(${TAG_NAME} | cut -d '/' -f 3)" + echo "DOCKER_IMAGE_TAG::$(${TAG_NAME} | cut -d '/' -f 3)" >> $GITHUB_OUTPUT - name: Kaniko build uses: aevea/action-kaniko@master with: From bedba8a4324d1a34e7b3038bb92bbfc51bb0ebbb Mon Sep 17 00:00:00 2001 From: Ilya Kogan Date: Fri, 5 Sep 2025 20:30:15 +0000 Subject: [PATCH 3/3] More changes requested by copilot --- .github/workflows/main.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 2239495..21c2f94 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,15 +39,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - uses: docker/metadata-action@v3 - id: metadata - with: - images: ghcr.io/${{ github.repository }} - name: Determine tag name from branch name env: BRANCH_NAME: "${{ github.event.pull_request.head.ref }}" run: | - echo "DOCKER_IMAGE_TAG::$(${BRANCH_NAME} | cut -d '/' -f 2)" >> $GITHUB_OUTPUT + echo "DOCKER_IMAGE_TAG::$($BRANCH_NAME | cut -d '/' -f 2)" >> $GITHUB_OUTPUT - name: Kaniko build uses: aevea/action-kaniko@master with: @@ -66,15 +62,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - uses: docker/metadata-action@v3 - id: metadata - with: - images: ghcr.io/${{ github.repository }} - name: Determine tag name from branch name env: TAG_NAME: "${{ github.event.pull_request.head.ref }}" run: | - echo "DOCKER_IMAGE_TAG::$(${TAG_NAME} | cut -d '/' -f 3)" >> $GITHUB_OUTPUT + echo "DOCKER_IMAGE_TAG::$($TAG_NAME | cut -d '/' -f 3)" >> $GITHUB_OUTPUT - name: Kaniko build uses: aevea/action-kaniko@master with: