Skip to content

Commit

Permalink
ci: renew release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Dec 31, 2023
1 parent 80f3bcc commit 6242b1c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Gem and Docker image
name: Release Gem

on:
workflow_dispatch:
Expand Down Expand Up @@ -50,17 +50,3 @@ jobs:
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 }}
25 changes: 25 additions & 0 deletions .github/workflows/image-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Docker image

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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 6242b1c

Please sign in to comment.