-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use devcontainers CLI directly (#548)
- Loading branch information
1 parent
53a44dd
commit ec58558
Showing
1 changed file
with
11 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,28 +16,11 @@ jobs: | |
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
- name: Compute tag for devcontainer image | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
name=ghcr.io/${{ github.repository }}/devcontainer | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=match,pattern=devcontainer/v(.*),group=1 | ||
sep-tags: "," | ||
|
||
- name: Update Tags to Fit into devcontainers/cli format | ||
id: dcmeta | ||
run: | | ||
prefix="ghcr.io/${{ github.repository }}/devcontainer" | ||
input_list="$DOCKER_METADATA_OUTPUT_TAGS" | ||
delimiter="," | ||
result_list=$(echo "$input_list" | sed "s|${prefix}:||g") | ||
echo "tags=$result_list" >> "$GITHUB_OUTPUT" | ||
tag="${GITHUB_REF#refs/tags/devcontainer/v}" | ||
echo "tag=$tag" >> "$GITHUB_OUTPUT" | ||
- name: Set up Depot CLI | ||
uses: depot/setup-action@v1 | ||
|
@@ -55,14 +38,14 @@ jobs: | |
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and release devcontainer Multi-Platform | ||
uses: devcontainers/[email protected] | ||
run: | | ||
npm install -g @devcontainers/cli | ||
devcontainer build \ | ||
--workspace-folder .github \ | ||
--image-name ghcr.io/${{ github.repository }}/devcontainer:${{ steps.meta.outputs.tag }} \ | ||
--image-name ghcr.io/${{ github.repository }}/devcontainer:latest \ | ||
--platform linux/amd64,linux/arm64 \ | ||
--push | ||
env: | ||
# see: https://github.com/devcontainers/ci/issues/191#issuecomment-1603857155 | ||
BUILDX_NO_DEFAULT_ATTESTATIONS: true | ||
with: | ||
imageName: ghcr.io/${{ github.repository }}/devcontainer | ||
imageTag: ${{ steps.dcmeta.outputs.tags }} | ||
# cacheFrom: ghcr.io/${{ github.repository }}/devcontainer | ||
platform: linux/amd64,linux/arm64 | ||
push: always | ||
subFolder: .github |