From 1d4ed0fb6a65c27de471c7853f47ac43782fb89e Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 29 Sep 2024 22:18:45 -0600 Subject: [PATCH 1/4] ci: push devcontainer on workflow dispatch --- .github/workflows/devcontainer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 08672eb7f1..0c741ef43a 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -64,7 +64,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v2 with: - push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) }} + push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' }} file: .devcontainer/Dockerfile tags: ghcr.io/${{ github.repository }}-dev:latest,ghcr.io/${{ github.repository }}-dev:${{ env.DOCKER_TAG }} build-args: | From aa83627b4ed8b5709df185b751baddc56159a55c Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 29 Sep 2024 22:34:23 -0600 Subject: [PATCH 2/4] ci: confuse usage of docker tag to clean --- .devcontainer/Dockerfile | 3 +++ .github/workflows/devcontainer.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 32fe7261de..605a0e14c4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -76,6 +76,9 @@ RUN if [ "$BUILD_TYPE" = "release" ]; then \ elif [ "$BUILD_TYPE" = "push" ]; then \ echo "Installing Dojo at commit $DOJO_VERSION"; \ dojoup -c $DOJO_VERSION; \ + elif [ "$BUILD_TYPE" = "workflow_dispatch" ]; then \ + echo "Installing Dojo at commit $DOJO_VERSION"; \ + dojoup -c $DOJO_VERSION; \ else \ echo "Installing latest stable version of Dojo"; \ dojoup; \ diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 0c741ef43a..e66c3568f0 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -54,6 +54,8 @@ jobs: - name: Set Docker tag for workflow_dispatch event if: github.event_name == 'workflow_dispatch' run: | + SHORT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7) + echo "tag_name=$SHORT_SHA" >> $GITHUB_OUTPUT echo "DOCKER_TAG=${{ inputs.docker_tag }}" >> $GITHUB_ENV - name: Set outputs From 71cba6d2befd732628103b8e5f6829688e83a8a4 Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 29 Sep 2024 22:40:29 -0600 Subject: [PATCH 3/4] ci: adjust dojo version to be used for dojoup --- .github/workflows/devcontainer.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index e66c3568f0..5d00545ed2 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -43,6 +43,7 @@ jobs: if: github.event_name == 'release' run: | echo "DOCKER_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + echo "DOJO_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV echo "tag_name=$DOCKER_TAG" >> $GITHUB_OUTPUT - name: Set Docker tag for push event @@ -50,12 +51,13 @@ jobs: run: | SHORT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7) echo "DOCKER_TAG=$SHORT_SHA" >> $GITHUB_ENV + echo "DOJO_VERSION=$SHORT_SHA" >> $GITHUB_OUTPUT - name: Set Docker tag for workflow_dispatch event if: github.event_name == 'workflow_dispatch' run: | SHORT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7) - echo "tag_name=$SHORT_SHA" >> $GITHUB_OUTPUT + echo "DOJO_VERSION=$SHORT_SHA" >> $GITHUB_OUTPUT echo "DOCKER_TAG=${{ inputs.docker_tag }}" >> $GITHUB_ENV - name: Set outputs @@ -72,7 +74,7 @@ jobs: build-args: | VARIANT=bookworm BUILD_TYPE=${{ github.event_name }} - DOJO_VERSION=${{ github.event.release.tag_name }} + DOJO_VERSION=${{ env.DOJO_VERSION }} platforms: linux/amd64,linux/arm64 cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-dev:latest From e2544f9fb09e81993b9ae5e86f096c59b4c6c74c Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 29 Sep 2024 22:50:50 -0600 Subject: [PATCH 4/4] ci: fix typo --- .github/workflows/devcontainer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 5d00545ed2..8fc354ebf7 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -51,13 +51,13 @@ jobs: run: | SHORT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7) echo "DOCKER_TAG=$SHORT_SHA" >> $GITHUB_ENV - echo "DOJO_VERSION=$SHORT_SHA" >> $GITHUB_OUTPUT + echo "DOJO_VERSION=$SHORT_SHA" >> $GITHUB_ENV - name: Set Docker tag for workflow_dispatch event if: github.event_name == 'workflow_dispatch' run: | SHORT_SHA=$(echo "${{ github.sha }}" | cut -c 1-7) - echo "DOJO_VERSION=$SHORT_SHA" >> $GITHUB_OUTPUT + echo "DOJO_VERSION=$SHORT_SHA" >> $GITHUB_ENV echo "DOCKER_TAG=${{ inputs.docker_tag }}" >> $GITHUB_ENV - name: Set outputs