-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (49 loc) · 1.5 KB
/
deploy.yml
File metadata and controls
53 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Deployment
on:
push:
branches:
- develop
- staging
release:
types:
- published
env:
IMAGE_NAME: git-hg-sync
GAR_LOCATION: us
GCP_PROJECT_ID: moz-fx-git-hg-sync-prod
GAR_REPOSITORY: git-hg-sync-prod
jobs:
preflight:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
image_tag_metadata: ${{ steps.compute-suffix.outputs.suffix }}
steps:
- id: compute-suffix
name: Compute image tag suffix
env:
REF_NAME: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
run: |
# For tags (releases), no suffix needed - reusable workflow will use tag name
if [[ "$REF_TYPE" == "tag" ]]; then
echo "suffix=" >> $GITHUB_OUTPUT
echo "Tag detected: $REF_NAME - no suffix will be added"
# For branches, use branch name as suffix (e.g., 'develop' or 'staging')
else
echo "suffix=$REF_NAME" >> $GITHUB_OUTPUT
echo "Branch detected: $REF_NAME - will create tag with suffix '--$REF_NAME'"
fi
deploy:
needs: preflight
permissions:
contents: read
id-token: write
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@1f9b33678875a335819c5aa1a68297858ba0ccf4
with:
image_name: "git-hg-sync"
gar_name: "git-hg-sync-prod"
project_id: "moz-fx-git-hg-sync-prod"
gar_location: "us"
image_tag_metadata: ${{ needs.preflight.outputs.image_tag_metadata }}