-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add find-jobs step to build-dev-container.yaml
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
Showing
1 changed file
with
47 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |