Skip to content

Commit

Permalink
fix: get id
Browse files Browse the repository at this point in the history
  • Loading branch information
polomarcus committed Nov 28, 2023
1 parent 1eb63e9 commit 275a799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/scaleway-down.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ jobs:
secret-key: ${{ secrets.SCW_SECRET_KEY }}
default-project-id: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
default-organization-id: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
- name: Get instance id and expose it in CONTAINER_ID env var
run: echo ::set-env name=CONTAINER_ID::$(cat "${GITHUB_WORKSPACE}/scw.output" | jq -r '.id')

- name: Get container ID
run: |
echo "CONTAINER_ID=$(scw container list name=${{ secrets.CONTAINER_NAME }} | awk 'NR==2{print $1}')" >> $GITHUB_ENV
- name: 0 instances
uses: jawher/[email protected]
env:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/scaleway-up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: '00 07 * * *'

jobs:
up:
build:
runs-on: ubuntu-latest
steps:
- name: Use CLI
Expand All @@ -20,14 +20,11 @@ jobs:
secret-key: ${{ secrets.SCW_SECRET_KEY }}
default-project-id: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
default-organization-id: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
- name: Get instance id and expose it in CONTAINER_ID env var
run: echo ::set-env name=CONTAINER_ID::$(cat "${GITHUB_WORKSPACE}/scw.output" | jq -r '.id')

- name: Get container ID
run: |
echo "CONTAINER_ID=$(scw container list name=${{ secrets.CONTAINER_NAME }} | awk 'NR==2{print $1}')" >> $GITHUB_ENV
- name: start 1 instance
- name: start 1 instances
uses: jawher/[email protected]
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
Expand Down

0 comments on commit 275a799

Please sign in to comment.