Merge pull request #1 from billiax/add-claude-github-actions-17742718… #2
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: Build & Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| IMAGE: ghcr.io/billiax/remote-coder | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| outputs: | |
| image_tag: ${{ steps.meta.outputs.tags }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/setup-buildx-action@v3 | |
| - id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE }} | |
| tags: | | |
| type=sha,prefix= | |
| type=raw,value=latest | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy: | |
| needs: build-and-push | |
| runs-on: claude-agent | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set image tag | |
| run: | | |
| TAG="${GITHUB_SHA::7}" | |
| sed -i "s|image: .*remote-coder:.*|image: ${{ env.IMAGE }}:${TAG}|" k8s/deployment.yaml | |
| cat k8s/deployment.yaml | |
| - name: Deploy to AKS | |
| run: | | |
| kubectl apply -f k8s/deployment.yaml | |
| kubectl apply -f k8s/service.yaml | |
| kubectl apply -f k8s/ingress.yaml | |
| kubectl rollout restart deployment/remote-coder -n remote-coder | |
| kubectl rollout status deployment/remote-coder -n remote-coder --timeout=120s |