9090 cache-key : ${{ env.REGISTRY }}/${{ matrix.image_name }}-cache
9191 build-args : |
9292 DEPLOY_ENV=prd
93- VITE_ENV="PROD"
94-
95- build-makefile :
96- permissions :
97- id-token : write
98- contents : write
99- runs-on : ubuntu-22.04
100- name : " Build image with Makefile"
101- strategy :
102- fail-fast : false
103- matrix :
104- application : [devex]
105- include :
106- - application : devex
107- image_name : devex
108- path : products/devex
109- tag_length : 8
110- tag_latest : false
111- env :
112- DOCKER_DOMAIN : asia-docker.pkg.dev
113- REGISTRY : asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-public
114- steps :
115- - name : Checkout code
116- uses : actions/checkout@v3
117- with :
118- submodules : recursive
119- ref : ${{ github.event.pull_request.head.ref }}
120- repository : ${{ github.event.pull_request.head.repo.full_name }}
121- fetch-depth : 0
122-
123- - name : " Authenticate to Google Cloud - production"
124- id : google-auth
125- uses : " google-github-actions/auth@v1"
126- with :
127- token_format : " access_token"
128- workload_identity_provider : " ${{ secrets.GCP_PRD_GITHUB_WIF }}"
129- service_account : " ${{ secrets.GCP_PRD_GITHUB_SA_DOCKER_REGISTRY }}"
130- create_credentials_file : true
131-
132- - name : Login to the registry - production
133- uses : docker/login-action@v2
134- with :
135- registry : ${{ env.DOCKER_DOMAIN }}
136- username : " oauth2accesstoken"
137- password : " ${{ steps.google-auth.outputs.access_token }}"
138-
139- - name : Get tag version - production
140- if : github.event_name == 'push'
141- id : set-tag
142- uses : Zilliqa/gh-actions-workflows/actions/generate-tag@v1
143- with :
144- tag : ${{ env.REGISTRY }}/${{ matrix.image_name }}
145- length : ${{ matrix.tag_length }}
146-
147- - name : " Build and push ${{ matrix.application }} - production"
148- if : github.event_name == 'push'
149- env :
150- ENVIRONMENT : prd
151- IMAGE_TAG : ${{ steps.set-tag.outputs.tags }}
152- ENV_FILES_DECRYPTER_NONPRD : ${{ secrets.ENV_FILES_DECRYPTER_NONPRD }}
153- ENV_FILES_DECRYPTER_PRD : ${{ secrets.ENV_FILES_DECRYPTER_PRD }}
154- run : |
155- cd ${{ matrix.path }}
156- make image/build-and-push
157-
158- - name : " Build and push ${{ matrix.application }} - production"
159- if : github.event_name == 'release'
160- env :
161- ENVIRONMENT : prd
162- IMAGE_TAG : ${{ env.REGISTRY }}/${{ matrix.image_name }}:${{ github.ref_name }}
163- ENV_FILES_DECRYPTER_NONPRD : ${{ secrets.ENV_FILES_DECRYPTER_NONPRD }}
164- ENV_FILES_DECRYPTER_PRD : ${{ secrets.ENV_FILES_DECRYPTER_PRD }}
165- run : |
166- cd ${{ matrix.path }}
167- make image/build-and-push
168-
169- - name : " Build and push ${{ matrix.application }} tag latest - production"
170- if : matrix.tag_latest == true && github.event_name == 'release'
171- env :
172- ENVIRONMENT : prd
173- IMAGE_TAG : ${{ env.REGISTRY }}/${{ matrix.image_name }}:latest
174- ENV_FILES_DECRYPTER_NONPRD : ${{ secrets.ENV_FILES_DECRYPTER_NONPRD }}
175- ENV_FILES_DECRYPTER_PRD : ${{ secrets.ENV_FILES_DECRYPTER_PRD }}
176- run : |
177- cd ${{ matrix.path }}
178- make image/build-and-push
93+ VITE_ENV="PROD"
0 commit comments