debug: add trace logging to template publish #4
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: Publish Dev Container Templates | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.devcontainer/**/devcontainer-template.json' | |
| - '.devcontainer/**/devcontainer.json' | |
| - '.github/workflows/publish-templates.yml' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install devcontainer CLI | |
| run: npm install -g @devcontainers/cli | |
| - name: Log in to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish templates | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| OWNER="${{ github.repository_owner }}" | |
| OWNER_LC=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]') | |
| # Publish all templates from .devcontainer folder | |
| devcontainer templates publish .devcontainer \ | |
| --registry "${{ env.REGISTRY }}" \ | |
| --namespace "$OWNER_LC" \ | |
| --log-level trace |