add db id generation #14
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: Create User DB | |
on: | |
push: | |
branches: | |
- feat/cloudsql-gh-action | |
workflow_dispatch: | |
jobs: | |
create-db: | |
runs-on: ubuntu-latest | |
steps: | |
- id: 'generate-db-id' | |
name: 'generate db id' | |
uses: 'yakubique/[email protected]' | |
with: | |
min: 111111 | |
max: 999999 | |
- id: 'auth' | |
name: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | |
- id: 'Set_up_Cloud_SDK' | |
name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: 'Use gcloud CLI to create DB' | |
run: 'gcloud sql databases create ${{ steps.generate-db-id.outputs.number }} --instance=idp-postgres-db' |