Skip to content

Commit a004d12

Browse files
committed
DX-1607 added ruby deploy
1 parent bd2bdad commit a004d12

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

.github/actions/deploy/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Container image that runs your code
2+
FROM ruby:latest
3+
4+
# Copies your code file from your action repository to the filesystem path `/` of the container
5+
COPY entrypoint.sh /entrypoint.sh
6+
7+
#Make entrypoint.sh exacutable
8+
RUN chmod +x /entrypoint.sh
9+
10+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
11+
ENTRYPOINT ["/entrypoint.sh"]

.github/actions/deploy/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# action.yml
2+
name: 'Deploy'
3+
description: 'Deploys the ruby sdk to Rubygems'
4+
runs:
5+
using: 'docker'
6+
image: 'Dockerfile'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
mkdir ~/.gem #Rubygems needs this directory for auth
4+
echo "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials #The file to store rubygems auth. Must be in this format
5+
chmod 0600 ~/.gem/credentials #Rubygems expects this permissions
6+
gem build *.gemspec
7+
gem push *.gem -k rubygems

.github/workflows/deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Deploy SDK
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
deploy:
10+
name: Deploy to PYPI
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Deploy to Rubygems
16+
uses: ./.github/actions/deploy
17+
env:
18+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}

0 commit comments

Comments
 (0)