memories/.github/workflows/go-vod.yml

71 lines
1.7 KiB
YAML
Raw Normal View History

2023-11-01 16:43:27 +00:00
name: go-vod
2022-11-11 04:26:21 +00:00
on:
push:
tags:
2023-11-01 16:43:27 +00:00
- "go-vod/*"
2022-11-11 04:26:21 +00:00
jobs:
2023-11-01 07:43:06 +00:00
binary:
2023-11-01 07:45:33 +00:00
name: Binary
2022-11-11 04:26:21 +00:00
runs-on: ubuntu-latest
container:
2023-02-24 08:29:50 +00:00
image: golang:1.20-bullseye
2022-11-11 04:26:21 +00:00
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
2023-11-01 16:43:27 +00:00
working-directory: go-vod
2023-11-01 07:15:28 +00:00
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -ldflags="-s -w" -o go-vod-amd64
2023-11-01 17:07:32 +00:00
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -buildvcs=false -ldflags="-s -w" -o go-vod-aarch64
2022-11-11 04:26:21 +00:00
- name: Upload to releases
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
2023-11-01 16:43:27 +00:00
file: go-vod/go-vod-*
2023-11-01 07:15:28 +00:00
file_glob: true
2022-11-11 04:26:21 +00:00
tag: ${{ github.ref }}
2023-02-24 08:29:50 +00:00
overwrite: true
2023-11-01 16:43:27 +00:00
make_latest: false
2023-11-01 07:36:38 +00:00
docker:
runs-on: ubuntu-latest
2023-11-01 07:45:33 +00:00
name: Docker
2023-11-01 07:36:38 +00:00
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get image label
id: image_label
2023-11-01 16:43:27 +00:00
run: echo "label=${GITHUB_REF#refs/tags/go-vod/}" >> $GITHUB_OUTPUT
2023-11-01 07:36:38 +00:00
- name: Build container image
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
2023-11-01 16:43:27 +00:00
context: './go-vod/'
2023-11-01 07:36:38 +00:00
no-cache: true
file: './go-vod/Dockerfile'
2023-11-01 07:36:38 +00:00
tags: radialapps/go-vod:${{ steps.image_label.outputs.label }} , radialapps/go-vod:latest
provenance: false