Skip to content

Merge pull request #3 from pnstack/develop #55

Merge pull request #3 from pnstack/develop

Merge pull request #3 from pnstack/develop #55

name: "Build dev container"
on:
push:
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
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:
fail-fast: false
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@v3
with:
use: true
# - 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 Docker registry
uses: docker/login-action@v3.0.0
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Build and run Dev Container task
uses: devcontainers/ci@v0.3
with:
subFolder: ./templates/${{ matrix.dir }}
imageName: npv2k1/codespace
cacheFrom: npv2k1/codespace:${{ matrix.dir }}-${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
imageTag: ${{ matrix.dir }}-${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
platform: linux/amd64,linux/arm64
push: always
# - 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 }}
# platform: linux/amd64,linux/arm64
# # push: always