name: Build & Push Devcontainer on: push: branches: - main - master paths: - ".devcontainer/**" - ".github/workflows/devcontainer-build.yaml" workflow_dispatch: schedule: # Weekly rebuild picks up upstream apt / Theos / SDK updates without # forcing a Dockerfile bump. - cron: "0 6 * * 1" permissions: contents: read packages: write concurrency: group: devcontainer-build-${{ github.ref }} cancel-in-progress: false env: # ghcr.io//-devcontainer — one image per template consumer. IMAGE_NAME: ghcr.io/${{ github.repository }}-devcontainer jobs: build: name: Build & Push runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: Log in to GHCR uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Buildx uses: docker/setup-buildx-action@v3 # devcontainers/ci reads .devcontainer/devcontainer.json (features + # Dockerfile) and produces the same image the local devcontainer would. # Cache-from the previous run makes incremental rebuilds seconds instead # of the 20+ minutes a cold Theos+SDKs+Ghidra install takes. - name: Build & push devcontainer image uses: devcontainers/ci@v0.3 with: imageName: ${{ env.IMAGE_NAME }} imageTag: latest,${{ github.sha }} cacheFrom: ${{ env.IMAGE_NAME }} push: always platform: linux/amd64,linux/arm64