-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
4,567 additions
and
266 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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
name: Publish Docker images | ||
|
||
env: | ||
PROJECT_ID: ${{ secrets.GCP_PROJECT }} | ||
REGION: ${{ secrets.GCP_REGION }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'staging' | ||
- 'test' | ||
- 'vcf' | ||
- 'gcp' | ||
- 'tetrapack' | ||
- 'dev' | ||
- 'demo' | ||
|
@@ -57,9 +62,14 @@ jobs: | |
name: Push API Docker image to Docker Hub | ||
runs-on: ubuntu-20.04 | ||
needs: wait_for_tests | ||
|
||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
|
@@ -72,6 +82,18 @@ jobs: | |
id: ecr-login | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: 'Authenticate to Google Cloud' | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: 'projects/168301767246/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | ||
service_account: '[email protected]' | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v1 | ||
|
||
- name: Authorize Docker push | ||
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
|
@@ -85,23 +107,33 @@ jobs: | |
ECR_REPOSITORY: api | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG api | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/api/main:${{ github.sha }} \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/api/main:latest \ | ||
api | ||
- name: Push API Docker image to AWS ECR | ||
- name: Push API Docker image to AWS and GCP | ||
env: | ||
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }} | ||
ECR_REPOSITORY: api | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/api/main:${{ github.sha }} | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/api/main:latest | ||
push_client_to_registry: | ||
name: Push Client Docker image to Docker Hub | ||
runs-on: ubuntu-20.04 | ||
needs: wait_for_tests | ||
|
||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
|
@@ -114,6 +146,18 @@ jobs: | |
id: ecr-login | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: 'Authenticate to Google Cloud' | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: 'projects/168301767246/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | ||
service_account: '[email protected]' | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v1 | ||
|
||
- name: Authorize Docker push | ||
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
|
@@ -134,25 +178,34 @@ jobs: | |
--build-arg NEXT_PUBLIC_API_URL=${{ secrets[format('NEXT_PUBLIC_API_URL_{0}', steps.extract_branch.outputs.branch-upper )] }} \ | ||
--build-arg CYPRESS_USERNAME=${{ secrets.CYPRESS_USERNAME }} \ | ||
--build-arg CYPRESS_PASSWORD=${{ secrets.CYPRESS_PASSWORD }} \ | ||
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | ||
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/client/main:${{ github.sha }} \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/client/main:latest \ | ||
client | ||
- name: Push Client Docker image to AWS ECR | ||
- name: Push Client Docker image to AWS and GCP | ||
env: | ||
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }} | ||
ECR_REPOSITORY: client | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/client/main:${{ github.sha }} | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/client/main:latest | ||
push_data_import_to_registry: | ||
name: Push Data Import Docker image to Docker Hub | ||
runs-on: ubuntu-20.04 | ||
needs: wait_for_tests | ||
|
||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
|
@@ -165,6 +218,18 @@ jobs: | |
id: ecr-login | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: 'Authenticate to Google Cloud' | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: 'projects/168301767246/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | ||
service_account: '[email protected]' | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v1 | ||
|
||
- name: Authorize Docker push | ||
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
|
@@ -178,23 +243,33 @@ jobs: | |
ECR_REPOSITORY: data_import | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG data | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/data-import/main:${{ github.sha }} \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/data-import/main:latest \ | ||
data | ||
- name: Push Data Import Docker image to AWS ECR | ||
- name: Push Data Import Docker image to AWS and GCP | ||
env: | ||
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }} | ||
ECR_REPOSITORY: data_import | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/data-import/main:${{ github.sha }} | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/data-import/main:latest | ||
push_tiler_to_registry: | ||
name: Push Tiler Docker image to AWS ECR | ||
name: Push Tiler Docker image to AWS and GCP | ||
runs-on: ubuntu-20.04 | ||
needs: wait_for_tests | ||
|
||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
|
@@ -207,6 +282,18 @@ jobs: | |
id: ecr-login | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: 'Authenticate to Google Cloud' | ||
uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: 'projects/168301767246/locations/global/workloadIdentityPools/github-pool/providers/github-provider' | ||
service_account: '[email protected]' | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v1 | ||
|
||
- name: Authorize Docker push | ||
run: gcloud auth configure-docker europe-west1-docker.pkg.dev | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
|
@@ -220,11 +307,17 @@ jobs: | |
ECR_REPOSITORY: tiler | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG tiler | ||
- name: Push Tiler Docker image to AWS ECR | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/tiler/main:${{ github.sha }} \ | ||
-t europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/tiler/main:latest \ | ||
tiler | ||
- name: Push Tiler Docker image to AWS and GCP | ||
env: | ||
ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }} | ||
ECR_REPOSITORY: tiler | ||
IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }} | ||
run: | | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/tiler/main:${{ github.sha }} | ||
docker push europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/tiler/main:latest |
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
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
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
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
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,3 @@ | ||
output "artifact_registry_repository_url" { | ||
value = "${google_artifact_registry_repository.repository.location}-docker.pkg.dev/${google_artifact_registry_repository.repository.project}/${google_artifact_registry_repository.repository.name}/main" | ||
} |
Oops, something went wrong.