|
11 | 11 |
|
12 | 12 | env: |
13 | 13 | 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 }} |
16 | 16 |
|
17 | 17 | jobs: |
18 | 18 | docker_build_and_push: |
|
49 | 49 | tags: | |
50 | 50 | ${{ env.DH_REGISTRY_NAME }}:latest |
51 | 51 | 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 |
54 | 54 | labels: ${{ steps.meta.outputs.labels }} |
55 | 55 |
|
56 | 56 | - name: Nightly build and push x86_64 |
|
62 | 62 | tags: | |
63 | 63 | ${{ env.DH_REGISTRY_NAME }}:nightly |
64 | 64 | 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 |
67 | 67 | 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 | + |
| 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