8000 GitHub - hpdobrica/push-to-gcr-github-action: An action that build docker image and push to Google Cloud Registry.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hpdobrica/push-to-gcr-github-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Push to GCR Github Action

An action that build docker image and push to Google Cloud Registry.

This action can be used to perform on every push or every tag creation.

Inputs

gcloud_service_key

The service account key of google cloud. The service accout json file must be encoded in base64. This field is required.

registry

The registry where the image should be pushedThe name of the person to greet. Default gcr.io.

project_name

The project name. This field is required.

image_name

The image name. This field is required.

image_tag

The tag for the image. Default: latest. To use the pushed Tag Name see the example.

NB: The

dockerfile

The image building Dockerfile. Default: ./Dockerfile. If context is changed, Dockerfile from context folder will be used.

context

The docker build context. Default: .

Example usage

Put desired yml section in the .github/workflows/build.yml file

name: Push to GCR Github Action
on: [push]
jobs:
  build-and-push-to-gcr:
    runs-on: ubuntu-latest
    steps:
      - uses: RafikFarhad/push-to-gcr-github-action@v1
        with:
          gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
          registry: gcr.io
          project_name: my-awesome-project
          image_name: server-end

name: Push to GCR Github Action
on:
  push:
    tags:
    - '*'
jobs:
  build-and-push-to-gcr:
    runs-on: ubuntu-latest
    steps:
      - name: Get the version
        id: get_tag_name
        run: echo ::set-output name=GIT_TAG_NAME::${GITHUB_REF/refs\/tags\//}
      - uses: RafikFarhad/push-to-gcr-github-action@v1
        with:
          gcloud_service_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
          registry: gcr.io
          project_name: my-awesome-project
          image_name: server-end
          image_tag: ${{ steps.get_tag_name.outputs.GIT_TAG_NAME}}
          dockerfile: ./build/Dockerfile

About

An action that build docker image and push to Google Cloud Registry.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 58.6%
  • Dockerfile 41.4%
0