Skip to content

Commit bc01209

Browse files
authored
Merge pull request #3 from weaveworks/release
Add release steps
2 parents fb6aed8 + c31e5fe commit bc01209

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/release.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
tags: [v*.*.*]
4+
5+
name: release
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Install Go
11+
uses: actions/setup-go@v2
12+
with:
13+
go-version: 1.17.x
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
- name: Build docker image
20+
run: |
21+
make docker-build
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v1
24+
with:
25+
registry: docker.io
26+
username: ${{ secrets.WGE_DOCKER_IO_USER }}
27+
password: ${{ secrets.WGE_DOCKER_IO_PASSWORD }}
28+
- name: Push image to docker registry
29+
run: |
30+
make docker-push
31+
32+
release:
33+
if: startsWith(github.ref, 'refs/tags/')
34+
runs-on: ubuntu-latest
35+
needs: build
36+
steps:
37+
- name: Build changelog
38+
id: github_release
39+
uses: mikepenz/release-changelog-builder-action@v2
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Release
43+
uses: softprops/action-gh-release@v1
44+
if: startsWith(github.ref, 'refs/tags/')
45+
with:
46+
prerelease: true
47+
body: ${{steps.github_release.outputs.changelog}}
48+

0 commit comments

Comments
 (0)