fix: Remove faulty git-auth command from startup script #45
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: Deploy Coder Templates | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: [ 'templates/**' ] # Only run if the files int eh templates folder change | |
| workflow_dispatch: | |
| jobs: | |
| # Detect which templates actually changed | |
| detect-changes: | |
| runs-on: coder-runner-set | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed template directories | |
| id: set-matrix | |
| run: | | |
| # Finds all unique directories under /templates that had changes | |
| # Formats them into a JSON array: ["project1", "project2"] | |
| DIRS=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | \ | |
| grep '^templates/' | cut -d/ -f2 | sort -u | jq -R -s -c 'split("\n")[:-1]') | |
| echo "matrix=$DIRS" >> $GITHUB_OUTPUT | |
| # Push only the changed templates | |
| deploy: | |
| needs: detect-changes | |
| if: ${{ needs.detect-changes.outputs.matrix != '[]' }} # Skips if no templates changed | |
| runs-on: coder-runner-set | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 4 | |
| matrix: | |
| template: ${{ fromJson(needs.detect-changes.outputs.matrix) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Coder CLI (Production matching version) | |
| run: curl -fsSL https://coder.umlcloudcomputing.org/install.sh | sh | |
| - name: Push Template to Coder | |
| env: | |
| CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }} | |
| CODER_URL: ${{ vars.CODER_URL }} | |
| run: | | |
| coder templates push ${{ matrix.template }} \ | |
| --directory ./templates/${{ matrix.template }} \ | |
| --yes \ | |
| --activate \ | |
| --ignore-lockfile \ | |
| --url $CODER_URL \ | |
| --token $CODER_SESSION_TOKEN | |