Skip to content

Commit 586f003

Browse files
authored
Use 'build' environment for Docker building and test login on pull-requests (#1539)
* Use 'build' environment for Docker building * Test login on pull-requests too
1 parent ae22fe5 commit 586f003

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/build-publish.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
GAR_REPOSITORY: telescope-prod
2424
GCP_PROJECT_ID: moz-fx-telescope-prod
2525
IMAGE: telescope
26+
environment: build
2627
steps:
2728
- name: Check out the repo
2829
uses: actions/checkout@v4
@@ -56,29 +57,26 @@ jobs:
5657
tags: |
5758
type=raw,value=latest
5859
type=raw,value=${{ steps.determine_tag.outputs.TAG }}
59-
60+
6061
- name: Set up Docker Buildx
6162
uses: docker/setup-buildx-action@v3
6263

63-
- id: gcp_auth
64-
name: gcp auth
65-
if: github.event_name != 'pull_request'
64+
- name: GCP Auth
65+
id: gcp_auth
6666
uses: google-github-actions/auth@v2
6767
with:
6868
token_format: access_token
6969
service_account: artifact-writer@${{ env.GCP_PROJECT_ID }}.iam.gserviceaccount.com
7070
workload_identity_provider: ${{ vars.GCPV2_GITHUB_WORKLOAD_IDENTITY_PROVIDER }}
7171

7272
- name: Login to GAR
73-
if: github.event_name != 'pull_request'
7473
uses: docker/login-action@v3
7574
with:
7675
registry: ${{ env.GAR_LOCATION }}-docker.pkg.dev
7776
username: oauth2accesstoken
7877
password: ${{ steps.gcp_auth.outputs.access_token }}
7978

8079
- name: Login to Docker Hub
81-
if: github.event_name != 'pull_request'
8280
uses: docker/login-action@v3
8381
with:
8482
username: ${{ secrets.DOCKERHUB_USERNAME }}

0 commit comments

Comments
 (0)