-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (52 loc) · 1.63 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Publish to RubyGems
on:
release:
types: [created]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
TARGET_URL: https://rubygems.org/gems/patch_ruby
steps:
- name: Check out code
uses: actions/checkout@v2
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
environment: production
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Build Gem
run: gem build -o patch_ruby.gem patch_ruby.gemspec
- name: Install Ruby Dependencies
run: bundle install
- name: Run RSpec
env:
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
run: bundle exec rspec
- name: Push to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: gem push patch_ruby.gem
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
state: "success"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}