-
Notifications
You must be signed in to change notification settings - Fork 19
45 lines (45 loc) · 1.45 KB
/
release.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
name: release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Unshallow
run: git fetch --prune --unshallow
- name: Highest tag
id: highestTag
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
echo highest=$(git tag | grep -E "^v?([0-9]+\.)+[0-9]+$" | sort -r -V | head -n1) >> $GITHUB_OUTPUT
- name: Enable experimental on dockerd
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Docker login
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
- name: Get tag
uses: little-core-labs/[email protected]
id: tagName
- name: Make release
run: make release
env:
DOCKER_CLI_EXPERIMENTAL: enabled
TAG: ${{ steps.tagName.outputs.tag }}
IMAGE_TAG: ${{ steps.tagName.outputs.tag }}
- name: Push latest
if: steps.tagName.outputs.tag == steps.highestTag.outputs.highest
run: make release
env:
DOCKER_CLI_EXPERIMENTAL: enabled
TAG: ${{ steps.tagName.outputs.tag }}
IMAGE_TAG: latest