Skip to content

Commit

Permalink
Refactor build-dev-container.yaml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Feb 2, 2024
1 parent 1fbcff0 commit 682799d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/build-dev-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,34 @@ on:
- master

jobs:

directories:
list-dir:
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]')"

- name: List Dir
id: list-dir
uses: pnstack/actions/list-dir@main
with:
dir: templates

log:
runs-on: ubuntu-latest
needs: [list-dir]
steps:
- name: Log
run: echo ${{fromJson(needs.list-dir.outputs.dir)}}

build:
runs-on: ubuntu-latest
needs: [directories]
# strategy:
# matrix:
# dir: ${{fromJson(needs.directories.outputs.dir)}}
needs: [list-dir]
strategy:
matrix:
dir: ${{fromJson(needs.list-dir.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
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -43,9 +46,6 @@ jobs:
- name: Build and run Dev Container task
uses: devcontainers/[email protected]
with:
subFolder: ./templates/ubuntu
# imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}container
imageName: ghcr.io/pnstack/codespace/ubuntu
# imageTag: ${{ matrix.dir }}
platform: linux/amd64,linux/arm64
subFolder: ./templates/${{ matrix.dir }}
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }}
push: always

0 comments on commit 682799d

Please sign in to comment.