Add fail-fast option to matrix strategy #36
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
name: 'Build dev container' | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
jobs: | ||
list-dir: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
dir: ${{ steps.list-dir.outputs.dir }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: List Dir | ||
id: list-dir | ||
uses: pnstack/actions/list-dir@main | ||
with: | ||
dir: templates | ||
- name: log | ||
run: echo ${{ steps.list-dir.outputs.dir }} | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: [list-dir] | ||
strategy: | ||
matrix: | ||
fail-fast: false | ||
dir: ${{fromJson(needs.list-dir.outputs.dir)}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- 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: ./templates/${{ matrix.dir }} | ||
imageName: ghcr.io/pnstack/codespace/${{ matrix.dir }} | ||
cacheFrom: ghcr.io/pnstack/codespace/${{ matrix.dir }}:latest | ||
imageTag: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }} | ||
push: always |