GCP workflow
This commit is contained in:
parent
9db021b9fa
commit
a6fbab9110
20
.github/workflows/push-container.yml
vendored
20
.github/workflows/push-container.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
|
SHA=${{ github.sha }}; BRANCH_NAME=${{ github.base_ref || github.ref_name }};
|
||||||
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
|
BUILD_ID=$BRANCH_NAME-${SHA:0:8};
|
||||||
DOCKER_IMAGE=${{ vars.docker_repo2_registry }}/$REPO:$BUILD_ID;
|
DOCKER_IMAGE="${{vars.GCP_DOCKER_REGISTRY}}/$REPO:$BUILD_ID"
|
||||||
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
|
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
|
||||||
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
|
echo "DOCKER_IMAGE=$DOCKER_IMAGE" >> "$GITHUB_OUTPUT";
|
||||||
|
|
||||||
@ -27,6 +27,24 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# ✅ 1) Auth to GCP (this is where your SA key is used)
|
||||||
|
- name: Auth to GCP
|
||||||
|
uses: google-github-actions/auth@v2
|
||||||
|
with:
|
||||||
|
# using your existing secret that contains the SA JSON
|
||||||
|
credentials_json: ${{ secrets.GCP_SA_KEY }}
|
||||||
|
|
||||||
|
# ✅ 2) Install gcloud (no creds here)
|
||||||
|
- name: Set up gcloud
|
||||||
|
uses: google-github-actions/setup-gcloud@v2
|
||||||
|
with:
|
||||||
|
project_id: ${{ secrets.GCP_PROJECT_ID }}
|
||||||
|
export_default_credentials: true
|
||||||
|
|
||||||
|
- name: Configure Docker for GAR
|
||||||
|
run: |
|
||||||
|
gcloud auth configure-docker $GCP_REGION-docker.pkg.dev
|
||||||
|
|
||||||
- name: Login to docker container registry
|
- name: Login to docker container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -129,4 +129,4 @@ dist
|
|||||||
.yarn/build-state.yml
|
.yarn/build-state.yml
|
||||||
.yarn/install-state.gz
|
.yarn/install-state.gz
|
||||||
.pnp.*
|
.pnp.*
|
||||||
|
.idea/
|
||||||
Loading…
x
Reference in New Issue
Block a user