Need help with gcloud?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

actions-hub
150 Stars 20 Forks MIT License 134 Commits 2 Opened issues

Description

GitHub Action for interacting with Google Cloud Platform (GCP)

Services available

!
?

Need anything else?

Contributors list

# 170,985
C#
Clojure
GitHub
github-...
122 commits
# 1,398
Shell
apache-...
Python
airflow
2 commits
# 406,987
hashico...
bulma-c...
vuejs
Shell
1 commit
# 270,239
PHP
HTML
Compose...
pusher
1 commit
# 38,555
CSS
React
GraphQL
macOS
1 commit
# 450,268
Shell
C#
Scala
contain...
1 commit

gcloud

Preview

GitHub Action which allows interacting with Google Cloud Platform.

Usage

To use gcloud in your workflow use:

- uses: actions-hub/[email protected]
  env:
    PROJECT_ID: test
    APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
  with:
    args: info

You can also use

gsutil
from Google Cloud SDK package.
- uses: actions-hub/[email protected]
  env:
    PROJECT_ID: test
    APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
  with:
    args: cp your-file.txt gs://your-bucket/
    cli: gsutil

Secrets

APPLICATION_CREDENTIALS
- To authorize in GCP you need to have a service account key. The recommended way to store the credentials in the secrets it previously encode file with base64. To encode a JSON file use:
base64 ~/.json
. Or you can put a JSON structure to the secret.

PROJECT_ID
- must be provided to activate a specific project.

Inputs

args
- command to run.

cli
- (optional) command line tool you want to use. Defaults to
gcloud
, allowed 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/[email protected]
  - uses: actions-hub/[email protected]
    env:
      PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
      APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
    with:
      args: app deploy app.yaml

Multistep

name: gcloud
on: [push]

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

steps:
  - uses: actions/[email protected]

  - name: "deploy to project A"  
    uses: actions-hub/[email protected]
    env:
      PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID_A}}
      APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
    with:
      args: app deploy app.yaml

  - name: "deploy to project B"  
    uses: actions-hub/[email protected]
    env:
      PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID_B}}
    with:
      args: app deploy app.yaml

Specific version

name: gcloud
on: [push]

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

steps:
  - uses: actions/[email protected]
  - uses: actions-hub/[email protected]
    env:
      PROJECT_ID: ${{secrets.GCLOUD_PROJECT_ID}}
      APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
    with:
      args: app deploy app.yaml

Licence

MIT License

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.