Skip to content

Commit

Permalink
feat: Add find-jobs step to build-dev-container.yaml
Browse files Browse the repository at this point in the history
This commit adds a new step called "find-jobs" to the build-dev-container.yaml workflow. The step uses the "philips-labs/list-folders-action@v1" action to list folders in the "./templates" directory and outputs the result as "folders". The step runs in a container based on Debian Buster Slim.

The commit also includes commented out code for the "matrix" and "build" steps, which are currently disabled.
  • Loading branch information
npv2k1 committed Feb 2, 2024
1 parent d12d088 commit fa3c30f
Showing 1 changed file with 47 additions and 27 deletions.
74 changes: 47 additions & 27 deletions .github/workflows/build-dev-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,59 @@ on: # rebuild any PRs and main branch changes

jobs:

list-folders:
runs-on: ubuntu-latest
find-jobs:
name: Find Jobs
container: debian:buster-slim
outputs:
folders: ${{ steps.jobs.outputs.folders }}
steps:
- uses: philips-labs/list-folder-action@v1
- uses: actions/checkout@v1

- id: jobs
uses: philips-labs/list-folders-action@v1
with:
directory: ./templates

build:
runs-on: ubuntu-latest
path: ./templates

matrix:
name: Matrix Jobs
needs: [find-jobs]
container: ubuntu
defaults:
run:
working-directory: ${{ matrix.folder }}
strategy:
matrix:
subfolder: ${{ fromJSON(needs.list-folders.outputs.folders) }}
folder: ${{ fromJson(needs.find-jobs.outputs.folders )}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: do something
run: echo ${{ matrix.folder }}

# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# subfolder: ${{ fromJSON(needs.list-folders.outputs.folders) }}
# steps:
# - name: Checkout
# uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
# - 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: 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/[email protected]
with:
subFolder: ./templates/${{ matrix.subfolder }}
imageName: ghcr.io/pnstack/codespace/${{ matrix.subfolder }}
platform: linux/amd64,linux/arm64
push: always
# - name: Build and run Dev Container task
# uses: devcontainers/[email protected]
# with:
# subFolder: ./templates/${{ matrix.subfolder }}
# imageName: ghcr.io/pnstack/codespace/${{ matrix.subfolder }}
# platform: linux/amd64,linux/arm64
# push: always

0 comments on commit fa3c30f

Please sign in to comment.