ops(fly): serialize rolling deploy and lengthen wait_timeout #42
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]*" | |
| jobs: | |
| build: | |
| uses: ./.github/workflows/docker-publish.yml | |
| permissions: | |
| contents: read | |
| packages: write | |
| deploy-k8s: | |
| needs: build | |
| runs-on: [self-hosted, k8s] | |
| steps: | |
| - name: Setup kubectl | |
| uses: azure/setup-kubectl@v5 | |
| with: | |
| version: v1.30.0 | |
| - name: Deploy to Kubernetes | |
| env: | |
| KUBECONFIG_B64: ${{ secrets.KUBECONFIG_B64 }} | |
| run: | | |
| trap 'rm -f kubeconfig' EXIT | |
| echo "${KUBECONFIG_B64}" | base64 -d > kubeconfig | |
| export KUBECONFIG=$PWD/kubeconfig | |
| REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
| IMAGE="ghcr.io/${REPO_LOWER}:${{ needs.build.outputs.image_tag }}" | |
| echo "Deploying ${IMAGE}" | |
| kubectl set image deployment/party-sockets party-sockets="${IMAGE}" -n default | |
| kubectl rollout status deployment/party-sockets -n default --timeout=5400s | |
| deploy-fly: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: superfly/flyctl-actions/setup-flyctl@master | |
| - name: Deploy ghcr image to Fly | |
| env: | |
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
| run: | | |
| REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | |
| flyctl deploy --image "ghcr.io/${REPO_LOWER}:${{ needs.build.outputs.image_tag }}" |