Only run dev container workflow if necessary #118
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Prebuild dev container | |
| on: | |
| push: | |
| paths: | |
| - .github/workflows/devcontainer.yml | |
| - .github/.devcontainer/** | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ghcr.io/object-object/mlogv32-devcontainer | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Remove unnecessary files | |
| uses: jlumbroso/[email protected] | |
| - uses: actions/checkout@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push dev container image | |
| uses: devcontainers/[email protected] | |
| with: | |
| subFolder: .github | |
| imageName: ${{ env.IMAGE_NAME }} | |
| cacheFrom: ${{ env.IMAGE_NAME }} | |
| push: always |