add ubuntu image #31
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: release | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: build_and_release | |
runs-on: ubuntu-latest | |
steps: | |
- name: clone | |
uses: actions/checkout@main | |
- name: Setup Go | |
uses: actions/setup-go@main | |
with: | |
go-version: 1.22 | |
- name: install depends | |
run: | | |
go mod download | |
mkdir artifacts | |
- name: build | |
run: | | |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o artifacts/custom-exporter | |
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o artifacts/custom-exporter-arm64 | |
- name: upload artifacts to cache | |
id: cache-artifacts | |
uses: actions/cache@main | |
with: | |
path: ./artifacts | |
key: artifacts | |
container_image: | |
name: container_image | |
runs-on: ubuntu-latest | |
outputs: | |
pushed-images: ${{ steps.build-images.outputs.pushed-images }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@main | |
- uses: orangeappsru/build-images-action@main | |
id: build-images | |
with: | |
registry: ghcr.io | |
registry-user: ${{ github.repository_owner }} | |
registry-password: ${{ secrets.GITHUB_TOKEN }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
operation: build-and-push | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-opts: | | |
- name: main | |
repo-image-name: true | |
latest: true | |
- name: alpine | |
- name: ubuntu | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
needs: [build, container_image] | |
steps: | |
- name: download cache-artifacts | |
uses: actions/cache/restore@main | |
with: | |
path: ./artifacts | |
key: artifacts | |
- name: ${{ github.ref_name }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: | | |
container images: | |
``` | |
${{ needs.container_image.outputs.pushed-images }} | |
``` | |
files: | | |
./artifacts/* |