-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
73 lines (70 loc) · 2.47 KB
/
action.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
63
64
65
66
67
68
69
70
71
72
73
name: Set up Ruby
description: Common actions for Rails and Ruby workflows
inputs:
ruby-version:
description: "Version of ruby to install"
required: false
default: ""
ssh-private-key:
description: "SSH key for checking out repos"
required: true
rubygems-key:
description: "Key for rubygems"
required: true
contribsys-key:
description: "Private key for Sidekiq Pro"
required: false
bundler-version:
description: "Version of bundler to install"
default: 'Gemfile.lock'
required: false
rails-master-key:
description: "master.key file contents to decrypt Rails encrypted credentials"
required: false
graphql-gem-key:
description: "Private key for GraphQL Pro/Enterprise gem"
required: false
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
# Setup SSH agent first to allow for checking out repos using SSH, as needed
- name: Set up SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ inputs.ssh-private-key }}
- name: Check for SASL dependencies
uses: tedconf/[email protected]
with:
gem-name: memcached
required-library: libsasl2-dev
- name: Check for cURL dependencies
uses: tedconf/[email protected]
with:
gem-name: curb
required-library: "libcurl4 libcurl3-gnutls libcurl4-openssl-dev"
- name: Set ruby version
id: ruby_version
shell: bash
run: |
if [ -n "${{ inputs.ruby-version }}" ]; then
ruby_version="${{ inputs.ruby-version }}"
else
ruby_version=$(tail .ruby-version)
fi
echo "Installing ruby version ${ruby_version}"
echo "RUBY_VERSION=${ruby_version}" >> $GITHUB_OUTPUT
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to ruby/setup-ruby@v1 (see
# https://github.com/ruby/setup-ruby#versioning)
uses: ruby/setup-ruby@v1
env:
BUNDLE_RUBYGEMS__TED__COM: ${{ inputs.rubygems-key }}
BUNDLE_GEMS__CONTRIBSYS__COM: ${{ inputs.contribsys-key }}
BUNDLE_GEMS__GRAPHQL__PRO: ${{ inputs.graphql-gem-key }}
RAILS_MASTER_KEY: ${{ inputs.rails-master-key }}
with:
ruby-version: ${{ steps.ruby_version.outputs.RUBY_VERSION }}
bundler: ${{ inputs.bundler-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically