Skip to content

Release

Release #5

Workflow file for this run

name: Release
on:
release:
types: [ published ]
env:
REGISTRY: ghcr.io
TCR_REGISTRY: hkccr.ccs.tencentyun.com
IMAGE_NAME: kainonly/accelerate
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ~1.21
- name: Build Server
run: go build
env:
CGO_ENABLED: 0
GO111MODULE: on
GOARCH: amd64
GOOS: linux
- name: Login GitHub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login TCR
uses: docker/login-action@v3
with:
registry: ${{ env.TCR_REGISTRY }}
username: ${{ secrets.TCR_USERNAME }}
password: ${{ secrets.TCR_PASSWORD }}
- name: Get Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ env.TCR_REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Push Images
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}