Stop Scaleway #371
This file contains 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: Stop Scaleway | |
on: | |
workflow_dispatch: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
schedule: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
- cron: '49 21 * * *' | |
jobs: | |
down: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Use CLI | |
uses: jawher/action-scw@v2.34.0 | |
env: | |
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
SCW_ZONE: ${{ secrets.SCW_ZONE }} | |
with: | |
args: container container list name=${{ secrets.CONTAINER_NAME }} --output json | |
- name: Get CONTAINER_ID env var | |
run: echo "CONTAINER_ID=$(cat "${GITHUB_WORKSPACE}/scw.output" | jq -r '.[0].id')" >> $GITHUB_ENV | |
- name: 0 instances | |
uses: jawher/action-scw@v2.34.0 | |
env: | |
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
SCW_ZONE: ${{ secrets.SCW_ZONE }} | |
with: | |
args: container container update min-scale=0 ${{ env.CONTAINER_ID }} |