Skip to content

Commit

Permalink
Create docker image with release tag automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jul 31, 2024
1 parent 92865d8 commit 8a3e84b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Ruby packages
on:
push:
tags:
- '*'

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Set latest flag for Ruby 3.3
if: contains(github.ref, 'v3_3')
run: |
echo "LATEST=true" >> $GITHUB_ENV
- name: Convert tag name to dot from underscore
run: |
# vX_Y_Z to X.Y.Z
echo "RUBY_VERSION=$(echo ${{ github.ref }} | sed 's/v\([0-9]*\)_\([0-9]*\)_\([0-9]*\)/\1.\2.\3/')" >> $GITHUB_ENV
- name: Send repository_dispatch
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/ruby/docker-images/dispatches \
-d '{"event_type": "release", "client_payload": {'ruby_version': ${{ env.RUBY_VERSION }}, 'arch': amd64, 'latest': ${{ env.LATEST }}, 'nopush': false}}'

0 comments on commit 8a3e84b

Please sign in to comment.