Skip to content

rorodata/gcloud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcloud

Preview

GitHub Action which allows interacting with Google Cloud Platform.

Usage

To use gcloud in your workflow use:

- uses: actions-hub/gcloud@master
  env:
    PROJECT_ID: test
    APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
  with:
    args: info

Args put command which needs to be executed.

You can also use gsutil which is packaged in the Google Cloud SDK.

- uses: actions-hub/gcloud@master
  env:
    PROJECT_ID: test
    APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
    CLI: gsutil
  with:
    args: cp your-file.txt gs://your-bucket/

Secrets

APPLICATION_CREDENTIALS - To authorize in GCP you need to have a service account key. Required Base64 encoded service account key exported as JSON. To encode a JSON file use: base64 ~/<account_id>.json

PROJECT_ID - must be provided to activate a specific project.

CLI - (optional) command line tool you want to use. Defaults to gcloud, authorized values: gcloud, gsutil.

Version

For each new release of gcloud master branch is updated to the latest version. Also, the tag is creating with the same number as the gcloud version. If you want to always have the latest version of gcloud, use @master branch. But if you need some specific version of gcloud just use a specific tag. For example @271.0.0.

Example

Latest version

name: gcloud
on: [push]

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions-hub/gcloud@master
        env:
          PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
          APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
        with:
          args: app deploy app.yaml

Specific version

name: gcloud
on: [push]

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions-hub/gcloud@271.0.0
        env:
          PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
          APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
        with:
          args: app deploy app.yaml

Licence

MIT License

Packages

No packages published

Languages

  • Shell 80.3%
  • Dockerfile 19.7%