Skip to content

Commit 21354cb

Browse files
authored
AE-956 [ads] Updated to reflect GHA changes (#475)
* Updated to reflect GHA changes using ./script/update_ci_config
1 parent 8a2fb67 commit 21354cb

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

.github/workflows/job-ads-attribution-dap-collector.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@v6
26-
2726
- name: Build the Docker image
2827
# yamllint disable
2928
run: |
@@ -32,27 +31,28 @@ jobs:
3231
- name: Test Code
3332
run: docker run us-docker.pkg.dev/moz-fx-data-artifacts-prod/docker-etl/ads-attribution-dap-collector:latest python3 -m pytest
3433

35-
push-job-ads-attribution-dap-collector:
34+
deploy-to-gar-ads-attribution-dap-collector:
35+
name: Deploy ads-attribution-dap-collector to GAR
3636
runs-on: ubuntu-latest
37-
needs: build-job-ads-attribution-dap-collector
37+
needs: [build-job-ads-attribution-dap-collector]
3838
if: github.ref == 'refs/heads/main'
39+
permissions:
40+
id-token: write
41+
contents: read
3942
steps:
4043
- name: Checkout code
4144
uses: actions/checkout@v6
42-
43-
- name: Authenticate to Google Cloud
44-
uses: google-github-actions/auth@v2
4545
with:
46-
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
47-
48-
- name: Set up Cloud SDK
49-
uses: google-github-actions/setup-gcloud@v2
50-
51-
- name: Configure Docker for GCR
52-
run: gcloud auth configure-docker
53-
54-
- name: Build Docker image
55-
run: docker build jobs/ads-attribution-dap-collector/ -t gcr.io/$${{ secrets.GCP_PROJECT }}/ads-attribution-dap-collector_docker_etl:latest
56-
57-
- name: Push to GCR
58-
run: docker push gcr.io/$${{ secrets.GCP_PROJECT }}/ads-attribution-dap-collector_docker_etl:latest
46+
persist-credentials: false
47+
- name: Build the Docker image
48+
# yamllint disable
49+
run: |
50+
docker build jobs/ads-attribution-dap-collector -t us-docker.pkg.dev/moz-fx-data-artifacts-prod/docker-etl/ads-attribution-dap-collector:latest
51+
# yamllint enable
52+
- name: Push Docker image latest to GAR
53+
uses: mozilla-it/deploy-actions/[email protected]
54+
with:
55+
project_id: moz-fx-data-artifacts-prod
56+
image_tags: us-docker.pkg.dev/moz-fx-data-artifacts-prod/docker-etl/ads-attribution-dap-collector:latest
57+
workload_identity_pool_project_number: ${{ vars.GCPV2_WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER }}
58+
service_account_name: docker-etl

jobs/ads-attribution-dap-collector/ci_job.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
steps:
44
- name: Checkout code
55
uses: actions/checkout@v6
6-
76
- name: Check if job files changed
87
id: changes
98
uses: dorny/paths-filter@v3
@@ -21,27 +20,28 @@
2120
if: steps.changes.outputs.job == 'true'
2221
run: docker run us-docker.pkg.dev/moz-fx-data-artifacts-prod/docker-etl/ads-attribution-dap-collector:latest python3 -m pytest
2322

24-
push-job-ads-attribution-dap-collector:
23+
deploy-to-gar-ads-attribution-dap-collector:
24+
name: Deploy ads-attribution-dap-collector to GAR
2525
runs-on: ubuntu-latest
26-
needs: build-job-ads-attribution-dap-collector
26+
needs: [build-job-ads-attribution-dap-collector]
2727
if: github.ref == 'refs/heads/main'
28+
permissions:
29+
id-token: write
30+
contents: read
2831
steps:
2932
- name: Checkout code
3033
uses: actions/checkout@v6
31-
32-
- name: Authenticate to Google Cloud
33-
uses: google-github-actions/auth@v2
3434
with:
35-
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
36-
37-
- name: Set up Cloud SDK
38-
uses: google-github-actions/setup-gcloud@v2
39-
40-
- name: Configure Docker for GCR
41-
run: gcloud auth configure-docker
42-
43-
- name: Build Docker image
44-
run: docker build jobs/ads-attribution-dap-collector/ -t gcr.io/$${{ secrets.GCP_PROJECT }}/ads-attribution-dap-collector_docker_etl:latest
45-
46-
- name: Push to GCR
47-
run: docker push gcr.io/$${{ secrets.GCP_PROJECT }}/ads-attribution-dap-collector_docker_etl:latest
35+
persist-credentials: false
36+
- name: Build the Docker image
37+
# yamllint disable
38+
run: |
39+
docker build jobs/ads-attribution-dap-collector -t us-docker.pkg.dev/moz-fx-data-artifacts-prod/docker-etl/ads-attribution-dap-collector:latest
40+
# yamllint enable
41+
- name: Push Docker image latest to GAR
42+
uses: mozilla-it/deploy-actions/[email protected]
43+
with:
44+
project_id: moz-fx-data-artifacts-prod
45+
image_tags: us-docker.pkg.dev/moz-fx-data-artifacts-prod/docker-etl/ads-attribution-dap-collector:latest
46+
workload_identity_pool_project_number: ${{ vars.GCPV2_WORKLOAD_IDENTITY_POOL_PROJECT_NUMBER }}
47+
service_account_name: docker-etl

0 commit comments

Comments
 (0)