Skip to content

feat: add devbox stack #13

feat: add devbox stack

feat: add devbox stack #13

Workflow file for this run

name: ci
on:
pull_request:
paths:
- "docker/**"
- "scripts/**"
- ".github/workflows/**"
- "README.md"
push:
branches: [main]
tags: ["*"]
env:
REGISTRY: ghcr.io/chaitin/monkeycode-runner
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- stack: base
version: bookworm
- stack: devbox
version: bookworm
- stack: golang
version: 1.25-bookworm
- stack: frontend
version: node20
- stack: rust
version: 1.91-bookworm
permissions:
contents: read
packages: write
env:
STACK: ${{ matrix.stack }}
VERSION: ${{ matrix.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ matrix.stack }}
tags: |
type=raw,value=${{ matrix.version }}
type=raw,value=${{ matrix.version }}-${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main' }}
type=ref,event=tag
type=raw,value=${{ matrix.version }}-${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build (no push on PR)
uses: docker/build-push-action@v5
with:
context: .
file: docker/${{ matrix.stack }}/${{ matrix.version }}/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}