Skip to content

first

first #15

Workflow file for this run

name: Go Blueprints CI and CD
on:
push:
paths:
- 'go/**'
pull_request:
paths:
- 'go/**'
env:
REGISTRY: ghcr.io
IMAGE_NAME: code-runner
BUILD_ARG_VERSION_NAME: GO_VERSION
concurrency:
group: go-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
go_version: [1.23, 1.24]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build go:${{ matrix.go_version }} image
uses: ./.github/actions/docker-build
with:
context: ./go
dockerfile: ./go/Dockerfile
image-name: ${{ env.IMAGE_NAME }}
tag: go-${{ matrix.go_version }}
push: false
container-registry: ${{ env.REGISTRY }}
build-arg-version-name: ${{ env.BUILD_ARG_VERSION_NAME }}
build-arg-version-value: ${{ matrix.go_version }}
cd:
runs-on: ubuntu-latest
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
strategy:
matrix:
go_version: [1.23, 1.24]
permissions:
packages: write
contents: read
needs:
- ci
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push go:${{ matrix.go_version }} image
uses: ./.github/actions/docker-build
with:
context: ./go
dockerfile: ./go/Dockerfile
image-name: ${{ env.IMAGE_NAME }}
tag: go-${{ matrix.go_version }}
push: true
container-registry: ${{ env.REGISTRY }}
container-registry-username: ${{ github.actor }}
container-registry-password: ${{ secrets.GITHUB_TOKEN }}
build-arg-version-name: ${{ env.BUILD_ARG_VERSION_NAME }}
build-arg-version-value: ${{ matrix.go_version }}