-
Notifications
You must be signed in to change notification settings - Fork 11
37 lines (34 loc) · 1023 Bytes
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Release
on:
release:
types: [published]
env:
IMAGE: "nccloud/mayfly"
REGISTRY: "ghcr.io"
GO_VERSION: "1.20"
TAG: ${{ github.event.release.tag_name }}
jobs:
release:
name: Release Image
runs-on: ubuntu-22.04
steps:
- name: Login
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Build Image
run: |
docker build -t ${{ env.REGISTRY}}/${{ env.IMAGE }}:${TAG#v} .
- name: Push Image
run: |
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE }}:${TAG#v} ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${TAG#v}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest