Skip to content

fix(devcontainer): use the default shell on Windows for #1

fix(devcontainer): use the default shell on Windows for

fix(devcontainer): use the default shell on Windows for #1

name: Build Dev Container
on:
workflow_dispatch:
push:
branches:
- "main"
paths:
- ".github/devcontainer/**"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
packages: "write"
contents: "read"
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v1
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Prepare DevPod
run: |
curl -L -o devpod "https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64" \
&& sudo install -c -m 0755 devpod /usr/local/bin \
&& rm -f devpod
devpod provider add docker
- name: "Build and push image"
run: |
for ARCH in amd64 arm64; do
# Build for $ARCH
devpod build . --devcontainer-path .github/devcontainer/devcontainer.json --platform linux/$ARCH --skip-push
ID=$(docker images --format "{{.ID}} {{.CreatedAt}} {{.Tag}}" | sort -rk 2 | grep "devpod" | awk 'NR==1{print $1}')
echo "found image: $ID"
if [ -z "${ID}" ]; then
echo "Image ID empty, exiting"
exit 0
fi
docker image ls
docker tag $ID ghcr.io/loft-sh/devpod:dev-$ARCH
docker push ghcr.io/loft-sh/devpod:dev-$ARCH
done
# Combine into multi-arch image
docker manifest create ghcr.io/loft-sh/devpod:dev \
--amend ghcr.io/loft-sh/devpod:dev-amd64 \
--amend ghcr.io/loft-sh/devpod:dev-arm64
docker manifest push ghcr.io/loft-sh/devpod:dev