-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.6 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
name: release
concurrency:
group: release
cancel-in-progress: true
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
container_image:
name: container_image
runs-on: ubuntu-latest
outputs:
image: ${{ steps.set-image-name.outputs.image }}
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
- name: image name
id: set-image-name
run: |
name="$(echo ${{ github.repository }} | tr 'A-Z' 'a-z')"
echo "image=ghcr.io/$name:${{ github.ref_name }}" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@master
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@master
with:
context: .
push: true
tags: ${{ steps.set-image-name.outputs.image }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: release
runs-on: ubuntu-latest
needs: [container_image]
steps:
- name: download cache-artifacts
uses: actions/cache/restore@main
with:
path: ./artifacts
key: artifacts
- name: ${{ github.ref_name }}
uses: softprops/action-gh-release@v2
with:
body: |
container image:
```
${{ needs.container_image.outputs.image }}
```
files: |
./artifacts/*