Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/test_gcloud_login.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Test gcloud-login
on:
push:
paths:
- "gcloud/login/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: docker build gcloud/login
13 changes: 1 addition & 12 deletions gcloud/login/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@

FROM docker:stable

LABEL version="1.0.0"

LABEL "version"="1.0.0"
LABEL "maintainer"="Rammus Xu <rammus.xu@swag.live>"
LABEL "com.github.actions.name"="GCR Login"
LABEL "com.github.actions.description"="use GCLOUD_AUTH"
LABEL "com.github.actions.icon"="terminal"
LABEL "com.github.actions.color"="green"


RUN apk update && \
apk add curl bash python git && \
RUN apk add curl bash python2 && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just inherit from google/cloud-sdk image

curl https://sdk.cloud.google.com | bash -s -- --disable-prompts

ENV PATH $PATH:/root/google-cloud-sdk/bin
Expand Down
6 changes: 3 additions & 3 deletions gcloud/login/action.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# action.yml
name: 'GCloud Login'
description: 'Login GCloud'
description: 'Login Google Cloud Platform'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'package'
color: 'blue'
icon: 'package'
color: 'blue'
4 changes: 2 additions & 2 deletions gcloud/login/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

echo "$GCLOUD_AUTH" | base64 -d > gcloud.json
Expand All @@ -8,4 +8,4 @@ gcloud auth activate-service-account --key-file=gcloud.json
# https://cloud.google.com/container-registry/docs/advanced-authentication
cat gcloud.json | docker login -u _json_key --password-stdin https://asia.gcr.io

bash -c "$*"
bash -c "$*"