Skip to content

update

update #21

name: 'Build dev container'
on:
pull_request:
push:
branches:
- master
jobs:
directories:
runs-on: ubuntu-latest
outputs:
dir: ${{ steps.set-dirs.outputs.dir }}
steps:
- uses: actions/checkout@v2
- id: set-dirs
run: echo "::set-output name=dir::$(ls -d templates/*/ | jq -R -s -c 'split("\n")[:-1]')"
build:
runs-on: ubuntu-latest
needs: [directories]
strategy:
matrix:
dir: ${{fromJson(needs.directories.outputs.dir)}}
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and run Dev Container task
uses: devcontainers/ci@v0.3
with:
subFolder: ${{ matrix.dir }}
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}/container
# imageTag: ${{ matrix.dir }}
# platform: linux/amd64,linux/arm64
push: always