Skip to content

Commit

Permalink
ci: release gem and also Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Dec 31, 2023
1 parent 7c72382 commit a0424ad
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Gem and Docker image

on:
workflow_dispatch:
Expand All @@ -16,7 +16,7 @@ jobs:
node-version:
- 20
ruby-version:
- 3.2
- 3.3
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,21 +32,35 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Buld the frontend app
- name: Buld frontend
run: |
npm install
npm run build
working-directory: frontend
- name: Copy the forntend assets
- name: Copy forntend assets
run: |
mkdir -p lib/mihari/web/public/
cp -r frontend/dist/* lib/mihari/web/public
- name: Configure Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Release
- name: Release gem
run: bundle exec rake release
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
GEM_HOST_OTP_CODE: ${{ inputs.rubygems-otp-code }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
docker build --tag ghcr.io/$GITHUB_ACTOR/mihari:latest \
--tag ghcr.io/$GITHUB_ACTOR/mihari:${{ github.event.release.tag_name }}
- name: Push Docker image
run: |
docker push ghcr.io/$GITHUB_ACTOR/mihari:latest
docker push ghcr.io/$GITHUB_ACTOR/mihari:${{ github.event.release.tag_name }}

0 comments on commit a0424ad

Please sign in to comment.