-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (24 loc) · 821 Bytes
/
docker.yml
File metadata and controls
28 lines (24 loc) · 821 Bytes
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
name: Docker
on:
push:
branches:
- main
tags:
- '*'
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image & push
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "main" ] && VERSION=latest
docker build -t ghcr.io/supplystack/fluxctl:$VERSION .
docker push ghcr.io/supplystack/fluxctl:$VERSION
if [ "$VERSION" != "latest" ] ; then
docker tag ghcr.io/supplystack/fluxctl:$VERSION ghcr.io/supplystack/fluxctl:latest
docker push ghcr.io/supplystack/fluxctl:latest
fi