Skip to content

Commit c32f46a

Browse files
authored
Merge pull request 0xPolygon#2628 from 0xPolygon/SPEC-1059-update-gcp-github-workflow
Update workflow to update docker image tag required for hosting
2 parents eb96206 + afaa4a9 commit c32f46a

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

.github/workflows/build_and_deploy_gcp.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ permissions:
2222
id-token: write
2323

2424
jobs:
25+
generate-version:
26+
uses: 0xPolygon/pipelines/.github/workflows/generate_version.yaml@main
27+
2528
build_and_deploy:
29+
needs:
30+
- generate-version
2631
runs-on: ubuntu-latest
2732
environment: ${{ inputs.environment }}
2833
permissions:
@@ -68,11 +73,7 @@ jobs:
6873
uses: docker/metadata-action@v5
6974
with:
7075
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
71-
tags: |
72-
type=ref,event=branch
73-
type=ref,event=pr
74-
type=semver,pattern={{version}}
75-
type=semver,pattern={{major}}.{{minor}}
76+
tags: ${{ needs.generate-version.outputs.version }}
7677
flavor: |
7778
latest=false
7879

.github/workflows/deploy_gcp.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,17 @@ on:
77
branches:
88
- dev
99
- main
10-
workflow_dispatch:
11-
inputs:
12-
environment:
13-
required: false
14-
type: choice
15-
description: "Select the environment to deploy to (only required for production deployment)"
16-
options:
17-
- staging
18-
- prod
1910

2011
jobs:
2112
deploy:
2213
if: |
2314
(github.event_name == 'pull_request' && startsWith(github.head_ref, 'hosted/')) ||
2415
(github.event_name == 'push' && github.ref == 'refs/heads/dev') ||
25-
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
26-
(github.event_name == 'workflow_dispatch' && inputs.environment == 'prod')
16+
(github.event_name == 'push' && github.ref == 'refs/heads/main')
2717
uses: ./.github/workflows/build_and_deploy_gcp.yml
2818
with:
29-
environment: ${{ inputs.environment ||
30-
(github.ref == 'refs/heads/dev' && 'dev') ||
19+
environment: ${{(github.ref == 'refs/heads/dev' && 'dev') ||
3120
(github.ref == 'refs/heads/main' && 'staging') ||
32-
(github.event_name == 'pull_request' && 'dev') ||
33-
'dev' }}
21+
(github.event_name == 'pull_request' && 'dev')}}
22+
core_app: ${{ github.ref == 'refs/heads/main' && 'polygon-docs-main' || 'polygon-docs-dev' }}
3423
secrets: inherit

branch/2604

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 3a58f283186885fabea877fe381fac8699c7d138

branch/dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit dc6f275d7b4a5af064b7a725ad2c55c244eaebca

0 commit comments

Comments
 (0)