Skip to content

Minor devcontainer updates (#546) #12

Minor devcontainer updates (#546)

Minor devcontainer updates (#546) #12

name: Dev Container Build and Push Image
on:
push:
tags:
- "devcontainer/v*.*.*"
jobs:
devcontainer-build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Docker meta
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"
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Setup Docker to use Depot
run: depot configure-docker
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and release devcontainer Multi-Platform
uses: devcontainers/[email protected]
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