Skip to content

Commit

Permalink
cleanup 2
Browse files Browse the repository at this point in the history
  • Loading branch information
rustielin committed Oct 3, 2023
1 parent b2385cb commit 00f8bd1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ permissions:
id-token: write #required for GCP Workload Identity federation which we use to login into Google Artifact Registry

jobs:
run-docker-buildx-setup:
run-docker-setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./docker-buildx-setup
- uses: ./docker-setup
run-gar-auth:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion docker-buildx-setup/README.md → docker-setup/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Description

Sets up docker buildx for use in other actions.
Sets up docker with buildx for use in other actions.

## Inputs

Expand Down
9 changes: 7 additions & 2 deletions docker-buildx-setup/action.yaml → docker-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup docker buildx
description: Sets up docker buildx for use in other actions.
name: Setup docker
description: Sets up docker with buildx for use in other actions.

inputs:
buildx_version:
Expand All @@ -13,8 +13,13 @@ runs:
id: buildx-context
shell: bash
run: docker context create builders

- name: setup docker buildx
uses: docker/[email protected]
with:
endpoint: builders
version: ${{ inputs.buildx_version }}

- uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # [email protected]
with:
version: v0.15.2
1 change: 1 addition & 0 deletions gar-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Authenticate to Google Cloud and login to Google Artifact Registry.
| --- | --- | --- | --- |
| GCP_WORKLOAD_IDENTITY_PROVIDER | The GCP Workload Identity Provider to use for authentication. | `true` | |
| GCP_SERVICE_ACCOUNT_EMAIL | The GCP Service Account Email to use for authentication. | `true` | |
| create_credentials_file | Whether to create a credentials file. | `false` | false |


## Runs
Expand Down
7 changes: 5 additions & 2 deletions gar-auth/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
GCP_SERVICE_ACCOUNT_EMAIL:
description: "The GCP Service Account Email to use for authentication."
required: true
create_credentials_file:
description: "Whether to create a credentials file."
default: "false"

runs:
using: composite
Expand All @@ -16,13 +19,13 @@ runs:
name: "Authenticate to Google Cloud"
uses: google-github-actions/[email protected]
with:
create_credentials_file: false
create_credentials_file: ${{ inputs.create_credentials_file == 'true' }}
token_format: "access_token"
workload_identity_provider: ${{ inputs.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ inputs.GCP_SERVICE_ACCOUNT_EMAIL }}

- name: Login to Google Artifact Registry
uses: docker/login-action@3.0.0
uses: docker/login-action@v3.0.0
with:
registry: us-docker.pkg.dev # use multi-region GAR
username: oauth2accesstoken
Expand Down

0 comments on commit 00f8bd1

Please sign in to comment.