-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.27 KB
/
release.yaml
File metadata and controls
56 lines (46 loc) · 1.27 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}/gamifykit
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
cache: true
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Go fmt / vet / test / staticcheck
run: |
go fmt ./...
go vet ./...
go test ./...
$(go env GOPATH)/bin/staticcheck ./...
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
run: |
TAG=${GITHUB_REF_NAME#refs/tags/}
IMAGE_TAG=${IMAGE_NAME}:${TAG}
docker build -t ${IMAGE_TAG} .
docker push ${IMAGE_TAG}
- name: Publish latest tag
run: |
docker tag ${IMAGE_NAME}:${GITHUB_REF_NAME#refs/tags/} ${IMAGE_NAME}:latest
docker push ${IMAGE_NAME}:latest