From e6807301fa7b3174bbf1d7776f8812d063331983 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Wed, 12 Jun 2024 12:36:04 -0700 Subject: [PATCH] ci(github): fix VSCode dev container publish job - use official builder 1. We don't have a Dockerfile anymore to define the image of the dev container instead the build's input is the `devcontainer.json` file which can be built using the `@devcontainers/cli` npm package instead of the usual `docker build` command on the terminal. 2. The ci.yaml job building the image was already doing the build this way but we must've forgotten to update the publish job as well. Signed-off-by: Peter Somogyvari --- .../workflows/dev-container-vscode-publish.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dev-container-vscode-publish.yaml b/.github/workflows/dev-container-vscode-publish.yaml index fc67ee927c..15a78370c3 100644 --- a/.github/workflows/dev-container-vscode-publish.yaml +++ b/.github/workflows/dev-container-vscode-publish.yaml @@ -16,6 +16,7 @@ concurrency: env: IMAGE_NAME: cactus-dev-container-vscode + NODEJS_VERSION: v18.18.2 jobs: # Push image to GitHub Packages. @@ -31,15 +32,17 @@ jobs: contents: read steps: + - name: Use Node.js ${{ env.NODEJS_VERSION }} + uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ env.NODEJS_VERSION }} - uses: actions/checkout@v4.1.1 - - - name: Build image - run: docker build "$DOCKER_BUILD_DIR" --file "$DOCKERFILE_PATH" --tag "$IMAGE_NAME" --label "runnumber=${GITHUB_RUN_ID}" - + - name: npm_install_@devcontainers/cli@0.44.0 + run: npm install -g @devcontainers/cli@0.44.0 + - name: npx_yes_devcontainers_cli_build + run: npx --yes @devcontainers/cli@0.44.0 build --workspace-folder="./" --log-level=trace --push=false --config="./.devcontainer/devcontainer.json" --image-name="$IMAGE_NAME" - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - name: Push image run: | SHORTHASH=$(git rev-parse --short "$GITHUB_SHA")