on:
  push:
    paths:
      - .devcontainer/devcontainer.json
      - .github/workflows/devcontainer.yml
      - .github/Dockerfile
permissions:
  contents: read
  packages: write
name: devcontainer
jobs:
  rebuild:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
      - name: Login to GitHub Container Registry
        uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Rebuild dev container image
        uses: devcontainers/ci@8bf61b26e9c3a98f69cb6ce2f88d24ff59b785c6 # v0.3
        with:
          imageName: ghcr.io/grpc-ecosystem/grpc-gateway/build-env
          cacheFrom: ghcr.io/grpc-ecosystem/grpc-gateway/build-env
          push: filter
          refFilterForPush: refs/heads/main
