-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.6 KB
/
ci.yml
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
name: ci
on:
pull_request:
push:
branches:
- master
release:
types: [published]
jobs:
build-image:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker build
run: make
- name: Test protoc
run: make test
- name: Login to GitHub Container Registry
if: github.event_name == 'push' || github.event_name == 'release'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy devel
if: github.event_name == 'push'
run: |
docker tag ghcr.io/seqsense/protoc-assets ghcr.io/seqsense/protoc-assets:devel
docker push ghcr.io/seqsense/protoc-assets:devel
- name: Deploy release
if: github.event_name == 'release'
run: |
IMAGE_TAG=${GITHUB_REF#refs/tags/}
docker tag ghcr.io/seqsense/protoc-assets ghcr.io/seqsense/protoc-assets:${IMAGE_TAG}
docker push ghcr.io/seqsense/protoc-assets:${IMAGE_TAG}
- name: Write tool versions to release notes
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMAGE_TAG=${GITHUB_REF#refs/tags/}
echo '## Tool versions' > ./notes
docker run ghcr.io/seqsense/protoc-assets cat /versions | xargs -L1 echo "-" >> ./notes
gh release edit ${IMAGE_TAG} \
--title ${IMAGE_TAG} \
--notes-file ./notes