Skip to content

Go Demo -- Build, Tag and Push Container Images to Repository #132

Go Demo -- Build, Tag and Push Container Images to Repository

Go Demo -- Build, Tag and Push Container Images to Repository #132

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"