Skip to content

Commit 759974b

Browse files
committed
update actions
1 parent 9e56dc2 commit 759974b

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

.github/workflows/release_docker.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111

1212
env:
1313
DH_REGISTRY_NAME: jqtype/modoh-server
14-
# GHCR: ghcr.io
15-
# GHCR_IMAGE_NAME: ${{ github.repository }}
14+
GHCR: ghcr.io
15+
GHCR_IMAGE_NAME: ${{ github.repository }}
1616

1717
jobs:
1818
docker_build_and_push:
@@ -49,8 +49,8 @@ jobs:
4949
tags: |
5050
${{ env.DH_REGISTRY_NAME }}:latest
5151
file: ./docker/Dockerfile
52-
cache-from: type=gha,scope=doh-auth-proxy-latest
53-
cache-to: type=gha,mode=max,scope=doh-auth-proxy-latest
52+
cache-from: type=gha,scope=modoh-server-latest
53+
cache-to: type=gha,mode=max,scope=modoh-server-latest
5454
labels: ${{ steps.meta.outputs.labels }}
5555

5656
- name: Nightly build and push x86_64
@@ -62,6 +62,43 @@ jobs:
6262
tags: |
6363
${{ env.DH_REGISTRY_NAME }}:nightly
6464
file: ./docker/Dockerfile
65-
cache-from: type=gha,scope=doh-auth-proxy-nightly
66-
cache-to: type=gha,mode=max,scope=doh-auth-proxy-nightly
65+
cache-from: type=gha,scope=modoh-server-nightly
66+
cache-to: type=gha,mode=max,scope=modoh-server-nightly
6767
labels: ${{ steps.meta.outputs.labels }}
68+
69+
dispatch_release:
70+
runs-on: ubuntu-latest
71+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'develop' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true }}
72+
needs: docker_build_and_push
73+
steps:
74+
- name: check pull_request title
75+
uses: kaisugi/[email protected]
76+
id: regex-match
77+
with:
78+
text: ${{ github.event.pull_request.title }}
79+
regex: "^(\\d+\\.\\d+\\.\\d+)$"
80+
81+
- name: checkout
82+
if: ${{ steps.regex-match.outputs.match != '' }}
83+
uses: actions/checkout@v4
84+
85+
- name: build release binary
86+
if: ${{ steps.regex-match.outputs.match != '' }}
87+
id: "build"
88+
run: |
89+
cargo build --release --package modoh-server
90+
cp ./target/release/modoh-server /tmp/modoh-server
91+
cd /tmp
92+
tar zcvf modoh-server-x86_64-unknown-linux-gnu.tar.gz modoh-server
93+
94+
- name: release
95+
if: ${{ steps.regex-match.outputs.match != ''}}
96+
uses: softprops/action-gh-release@v1
97+
with:
98+
files: /tmp/modoh-server-x86_64-unknown-linux-gnu.tar.gz
99+
name: ${{ github.event.pull_request.title }}
100+
tag_name: ${{ github.event.pull_request.title }}
101+
body: ${{ github.event.pull_request.body }}
102+
draft: true
103+
prerelease: false
104+
generate_release_notes: true

0 commit comments

Comments
 (0)