escape output #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [ push, workflow_dispatch ] | |
env: | |
REGISTRY: docker.io/orsol/go-rest-service-template | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.21 | |
- uses: actions/checkout@v4 | |
- name: Build | |
shell: bash | |
run: make build | |
- name: Test | |
shell: bash | |
run: go test -v ./... -coverprofile="coverage.out" | |
- name: Init vars | |
id: vars_step | |
uses: ./.github/actions/git-vars | |
- name: Login to Docker registry | |
shell: bash | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
run: | | |
buildah login \ | |
--username $DOCKERHUB_USERNAME \ | |
--password $DOCKERHUB_TOKEN \ | |
$REGISTRY | |
# publish image with application with three tags `latest`, commit-sha and branch with build number | |
- name: OCI build and push | |
shell: bash | |
run: | | |
buildah bud --pull -t $REGISTRY\:${{ steps.vars_step.outputs.sha-short }} \ | |
-t $REGISTRY\:${{ steps.vars_step.outputs.branch }}-${{ github.run_number }} \ | |
-t $REGISTRY\:latest . && \ | |
buildah push $REGISTRY\:${{ steps.vars_step.outputs.branch }}-${{ github.run_number }} && \ | |
buildah push $REGISTRY\:${{ steps.vars_step.outputs.sha-short }} | |
buildah push $REGISTRY\:latest | |
# Service test image is published to the same repository but `-test` prefix added to tags. | |
# That way it's easier to run it in kubernetes | |
- name: OCI Push Integration Tests | |
shell: bash | |
working-directory: ${{ inputs.working-directory }} | |
run: | | |
buildah bud --pull -f Int.Dockerfile -t $REGISTRY\:${{ steps.vars_step.outputs.sha-short }}-test \ | |
-t $REGISTRY\:${{ steps.vars_step.outputs.branch }}-${{ github.run_number }}-test \ | |
-t $REGISTRY\:latest-test . && \ | |
buildah push $REGISTRY\:${{ steps.vars_step.outputs.branch }}-${{ github.run_number }}-test && \ | |
buildah push $REGISTRY\:latest-test | |