-
Notifications
You must be signed in to change notification settings - Fork 21
41 lines (37 loc) · 1.12 KB
/
ci.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: CI
on: [push]
jobs:
release-images:
# Only on main branch.
if: startsWith(github.ref, 'refs/heads/main')
env:
IMAGE_NAME: ghcr.io/${GITHUB_REPOSITORY}
VERSION: ${GITHUB_SHA}
name: Release images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish docker images
run: make build-publish-image
tagged-release-images:
# Only on tags.
if: startsWith(github.ref, 'refs/tags/')
env:
IMAGE_NAME: ghcr.io/${GITHUB_REPOSITORY}
name: Tagged release images
runs-on: ubuntu-latest
steps:
- run: echo "VERSION=${GITHUB_REF#refs/*/}" >> ${GITHUB_ENV} # Sets VERSION env var.
- uses: actions/checkout@v3
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish docker images
run: make build-publish-image