-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 1.55 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
62
63
64
65
66
67
68
69
name: Release
on:
push:
branches:
- main
jobs:
version:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Install jq
run: sudo apt install jq -y
- name: Get latest version
id: version
run: |
chmod u+x ./version.sh
./version.sh >> $GITHUB_OUTPUT
release:
runs-on: ubuntu-22.04
permissions:
contents: write
packages: write
needs:
- version
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- name: Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.version.outputs.version }}
release_name: Release v${{ needs.version.outputs.version }}
draft: false
prerelease: false
docker:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
needs:
- version
- release
steps:
- uses: actions/checkout@v3
- name: Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ needs.version.outputs.version }}