-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add a workflow to push to a docker repository to share with ex…
…ternal clients (#10484)
- Loading branch information
1 parent
4275325
commit 8d53813
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Ironbank Image Upload | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_number: | ||
description: "Version number of the Parabol application image to process" | ||
required: true | ||
|
||
jobs: | ||
pull-and-upload: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
steps: | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- id: "auth" | ||
name: "Authenticate to Google Cloud" | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
token_format: "access_token" | ||
workload_identity_provider: ${{ secrets.GCP_WI_PROVIDER_NAME }} | ||
service_account: ${{ secrets.GCP_SA_EMAIL }} | ||
|
||
- uses: "docker/login-action@v3" | ||
with: | ||
registry: ${{ secrets.GCP_DOCKER_REGISTRY }} | ||
username: "oauth2accesstoken" | ||
password: "${{ steps.auth.outputs.access_token }}" | ||
|
||
- name: Pull Docker image from GCP | ||
run: docker pull ${{ secrets.GCP_AR_PARABOL}}:v${{ github.event.inputs.version_number }} | ||
|
||
- name: Push Docker image to the external repository | ||
run: |- | ||
gcloud container images add-tag -q \ | ||
${{ secrets.GCP_AR_PARABOL }}:v${{ github.event.inputs.version_number }} \ | ||
${{ secrets.GCP_AR_PARABOL_EXTERNAL }}:v${{ github.event.inputs.version_number }} |