Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Commit

Permalink
[+] fix : add build arg on CI when building image
Browse files Browse the repository at this point in the history
  • Loading branch information
aslupin committed Mar 23, 2021
1 parent 4871ef9 commit d5dde81
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/push-image-prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Push Image (Production)"
name: 'Push Image (Production)'

on:
push:
Expand All @@ -15,7 +15,7 @@ jobs:
- name: Setup GCP Service Account
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: "latest"
version: 'latest'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Build
run: |
docker build -f ./docker/prod.Dockerfile . -t asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCR_IMAGE_NAME_PROD }}
docker build -f ./docker/prod.Dockerfile . -t asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCR_IMAGE_NAME_PROD }} --build-arg GIT_ACCESS_TOKEN_CURL_CONFIG=${{ secrets.GIT_ACCESS_TOKEN_CURL_CONFIG }}
- name: Push
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/push-image-stag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Push Image (Staging)"
name: 'Push Image (Staging)'

on:
push:
Expand All @@ -15,7 +15,7 @@ jobs:
- name: Setup GCP Service Account
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: "latest"
version: 'latest'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Build
run: |
docker build -f ./docker/stag.Dockerfile . -t asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCR_IMAGE_NAME }}
docker build -f ./docker/stag.Dockerfile . -t asia.gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCR_IMAGE_NAME }} --build-arg GIT_ACCESS_TOKEN_CURL_CONFIG=${{ secrets.GIT_ACCESS_TOKEN_CURL_CONFIG }}
- name: Push
run: |
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@ GCR_TagStaging := asisa.gcr.io/${GCP_ProjectID}/${ImageName}

docker-build:
docker build -f ${DockerPath} . -t ${GCR_TagStaging}

docker-push:
docker push ${GCR_TagStaging}

docker-build-push:
make docker-build; \
make docker-push;

hand-deploy-to-stag-step-1:
git push -u origin develop; \
git checkout stag-release; \
git pull origin develop;

hand-deploy-to-stag-step-2:
git push -u origin stag-release; \
git checkout develop;

hand-gcr-to-stag-step-1:
git push -u origin develop; \
git checkout stag-release-image; \
git pull origin develop;

hand-gcr-to-stag-step-2:
git push -u origin stag-release-image; \
git checkout develop;

hand-gcr-to-prod-step-1:
git push -u origin develop; \
Expand Down

0 comments on commit d5dde81

Please sign in to comment.