1+ name : shisui image
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ defaults :
8+ run :
9+ shell : bash
10+
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+ permissions :
16+ contents : write
17+
18+ env :
19+ releaseBuild : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
20+ REGISTRY : ghcr.io
21+ IMAGE_NAME : ${{ github.repository }}
22+
23+ jobs :
24+
25+ push_image_to_github :
26+ name : Push Docker image to Github
27+ runs-on : ubuntu-latest
28+ permissions : write-all
29+ steps :
30+ - name : Check out the repo
31+ uses : actions/checkout@v4
32+ - name : Log in to Docker Hub
33+ uses : docker/login-action@v3
34+ with :
35+ registry : ${{ env.REGISTRY }}
36+ username : ${{ github.actor }}
37+ password : ${{ secrets.GITHUB_TOKEN }}
38+
39+ - name : Extract metadata (tags, labels) for Docker
40+ id : meta
41+ uses : docker/metadata-action@v5
42+ with :
43+ images : ${{ env.REGISTRY }}/${{ github.repository }}
44+ tags : |
45+ type=semver,pattern={{raw}}
46+
47+ - name : Build and push Docker image
48+ uses : docker/build-push-action@v5
49+ with :
50+ context : .
51+ file : ./Dockerfile.portal
52+ push : true
53+ tags : ${{ steps.meta.outputs.tags }}
54+ labels : ${{ steps.meta.outputs.labels }}
55+
56+
57+ release :
58+ name : 🚰 Release new version.
59+ needs : push_image_to_github
60+ runs-on : ubuntu-latest
61+
62+ steps :
63+ - name : 🛎️Check out the source code
64+ uses : actions/checkout@v3
65+ with :
66+ fetch-depth : 0
67+ submodules : recursive
68+
69+ - name : ⚙️Build Changelog
70+ id : github_release
71+ uses : mikepenz/release-changelog-builder-action@v4
72+ with :
73+ configuration : " .github/config/configuration.json"
74+ commitMode : true
75+ ignorePreReleases : ${{ !contains(github.ref, '-') }}
76+ env :
77+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+
79+ - name : ⏬Download all the build artifacts
80+ uses : actions/download-artifact@v3
81+ with :
82+ path : release-artifacts
83+
84+ - name : ✨Github Release
85+ uses : softprops/action-gh-release@v1
86+ with :
87+ body : ${{ steps.github_release.outputs.changelog }}
88+ files : |
89+ ${{ github.workspace }}/release-artifacts/**
90+ generate_release_notes : true
91+ fail_on_unmatched_files : true
92+ env :
93+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments