-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 1.9 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: release
on:
push:
tags:
- 'v*'
env:
IMAGE_NAME: ${{ github.event.repository.name }}
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download release notes utility
env:
GH_REL_URL: https://github.com/buchanae/github-release-notes/releases/download/0.2.0/github-release-notes-linux-amd64-0.2.0.tar.gz
run: cd /tmp && curl -sSL ${GH_REL_URL} | tar xz && sudo mv github-release-notes /usr/local/bin/
- name: Generate release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo 'CHANGELOG' > /tmp/release.txt
github-release-notes -org sngular -repo gitops-echobot -since-latest-release >> /tmp/release.txt
- name: Create release
uses: ncipollo/release-action@v1
with:
bodyFile: "/tmp/release.txt"
token: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build and push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: sngular-admin
password: ${{ secrets.GHCR_TOKEN }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
file: ./Dockerfile
tags: |
ghcr.io/sngular/${{ env.IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}