Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Jan 18, 2024
1 parent 9e56dc2 commit 759974b
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:

env:
DH_REGISTRY_NAME: jqtype/modoh-server
# GHCR: ghcr.io
# GHCR_IMAGE_NAME: ${{ github.repository }}
GHCR: ghcr.io
GHCR_IMAGE_NAME: ${{ github.repository }}

jobs:
docker_build_and_push:
Expand Down Expand Up @@ -49,8 +49,8 @@ jobs:
tags: |
${{ env.DH_REGISTRY_NAME }}:latest
file: ./docker/Dockerfile
cache-from: type=gha,scope=doh-auth-proxy-latest
cache-to: type=gha,mode=max,scope=doh-auth-proxy-latest
cache-from: type=gha,scope=modoh-server-latest
cache-to: type=gha,mode=max,scope=modoh-server-latest
labels: ${{ steps.meta.outputs.labels }}

- name: Nightly build and push x86_64
Expand All @@ -62,6 +62,43 @@ jobs:
tags: |
${{ env.DH_REGISTRY_NAME }}:nightly
file: ./docker/Dockerfile
cache-from: type=gha,scope=doh-auth-proxy-nightly
cache-to: type=gha,mode=max,scope=doh-auth-proxy-nightly
cache-from: type=gha,scope=modoh-server-nightly
cache-to: type=gha,mode=max,scope=modoh-server-nightly
labels: ${{ steps.meta.outputs.labels }}

dispatch_release:
runs-on: ubuntu-latest
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 }}
needs: docker_build_and_push
steps:
- name: check pull_request title
uses: kaisugi/action-regex-match@v1.0.0
id: regex-match
with:
text: ${{ github.event.pull_request.title }}
regex: "^(\\d+\\.\\d+\\.\\d+)$"

- name: checkout
if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/checkout@v4

- name: build release binary
if: ${{ steps.regex-match.outputs.match != '' }}
id: "build"
run: |
cargo build --release --package modoh-server
cp ./target/release/modoh-server /tmp/modoh-server
cd /tmp
tar zcvf modoh-server-x86_64-unknown-linux-gnu.tar.gz modoh-server
- name: release
if: ${{ steps.regex-match.outputs.match != ''}}
uses: softprops/action-gh-release@v1
with:
files: /tmp/modoh-server-x86_64-unknown-linux-gnu.tar.gz
name: ${{ github.event.pull_request.title }}
tag_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: true
prerelease: false
generate_release_notes: true

0 comments on commit 759974b

Please sign in to comment.