-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (35 loc) · 1.12 KB
/
mozcloud-publish.yaml
File metadata and controls
37 lines (35 loc) · 1.12 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
name: Go Demo -- Build, Tag and Push Container Images to Repository
on:
pull_request:
types: [labeled, unlabeled, synchronize]
push:
branches:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+
workflow_dispatch: {}
jobs:
build-and-push:
if: >
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'preview') &&
github.event.pull_request.head.repo.full_name == github.repository
)
permissions:
contents: read
packages: write # Only required if you're publishing to GHCR
id-token: write
secrets: inherit
uses: mozilla-it/deploy-actions/.github/workflows/build-and-push.yml@main
with:
image_name: go-demo
gar_name: cicd-demos-nonprod
project_id: moz-fx-cicd-demos-nonprod
should_tag_ghcr: true
image_build_context: "./go-demo/"
dockerfile_path: "./go-demo/Dockerfile"
prebuild_script: "cd go-demo && make mozcloud-prebuild"
postbuild_script: "cd go-demo && make mozcloud-postbuild"