name: "Devcontainer" on: push: branches: - main pull_request: paths: - ".devcontainer/**" permissions: {} # Only allow one run of the workflow per branch / PR at a time. concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: build: name: "Build devcontainer" runs-on: ubuntu-26.04 permissions: contents: read packages: read steps: - name: Checkout sources uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Login to GitHub Container Registry uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Pre-build dev container image uses: devcontainers/ci@513af61f4de4f75d37e4438f184ba4358f0fc1ca # v0.3.1900000450 with: imageName: ghcr.io/reubeno/brush/devcontainer imageTag: latest cacheFrom: ghcr.io/reubeno/brush/devcontainer push: never build_and_publish: name: "Build and publish devcontainer" runs-on: ubuntu-26.04 permissions: contents: read packages: write steps: - name: Checkout sources uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Login to GitHub Container Registry uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Pre-build dev container image uses: devcontainers/ci@513af61f4de4f75d37e4438f184ba4358f0fc1ca # v0.3.1900000450 with: imageName: ghcr.io/reubeno/brush/devcontainer imageTag: latest cacheFrom: ghcr.io/reubeno/brush/devcontainer push: filter refFilterForPush: refs/heads/main eventFilterForPush: push