generated from cybozu-go/neco-template
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.39 KB
/
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
38
39
40
41
name: Release
on:
push:
tags:
- 'v*'
jobs:
image:
name: Push Container image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- run: make docker-build
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to ghcr.io
run: |
IMAGE_TAG=${GITHUB_REF#refs/tags/v} # Remove "v" prefix.
docker tag nyamber-controller:dev ghcr.io/cybozu-go/nyamber-controller:$IMAGE_TAG
docker push ghcr.io/cybozu-go/nyamber-controller:$IMAGE_TAG
docker tag localhost:5151/nyamber-runner:dev ghcr.io/cybozu-go/nyamber-runner:$IMAGE_TAG
docker push ghcr.io/cybozu-go/nyamber-runner:$IMAGE_TAG
release:
name: Release on GitHub
needs: image
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=${GITHUB_REF#refs/tags/} # Don't remove "v" prefix.
if echo ${VERSION} | grep -q -e '-'; then PRERELEASE_FLAG=-p; fi
gh release create $VERSION $PRERELEASE_FLAG \
-t "Release $VERSION" \
-n "See [CHANGELOG.md](./CHANGELOG.md) for details."