start-cluster #924
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: start-cluster | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # - cron: '0 4 * * 1-5' #utc Summer time | |
| - cron: '0 5 * * 1-5' #utc Winter time | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| start-dev-clusters: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - name: 'Clone repo' | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: 'Terraform CLI' | |
| uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0 | |
| with: | |
| terraform_version: 'latest' | |
| - name: 'Az CLI login' | |
| uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 | |
| with: | |
| client-id: "94ad7918-e504-4132-9916-0293689cd140" | |
| tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0" | |
| subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b" | |
| - name: Get GitHub Public IP | |
| id: github_public_ip | |
| run: echo "ipv4=$(curl 'https:///ifconfig.me/ip')" >> $GITHUB_OUTPUT | |
| - name: Add GitHub IP to StorageAccount | |
| run: | | |
| az storage account network-rule add \ | |
| --resource-group "s941-tfstate" \ | |
| --account-name "s941radixinfra" \ | |
| --ip-address ${{ steps.github_public_ip.outputs.ipv4 }} >/dev/null | |
| - name: Lets sleep for 30 seconds for FW rule to complete | |
| run: sleep 30s | |
| - name: Start clusters | |
| run: RADIX_ZONE=dev SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK }} TASK=start .github/workflows/scripts/dailytasks.sh | |
| - name: Revoke GitHub IP on StorageAccount | |
| run: | | |
| az storage account network-rule remove \ | |
| --resource-group "s941-tfstate" \ | |
| --account-name "s941radixinfra" \ | |
| --ip-address ${{ steps.github_public_ip.outputs.ipv4 }} >/dev/null |