-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathaction.yml
More file actions
70 lines (63 loc) · 2.23 KB
/
action.yml
File metadata and controls
70 lines (63 loc) · 2.23 KB
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
# Control Plane GitHub Action
name: Deploy-To-Control-Plane
description: 'Deploys both to staging and to review apps'
inputs:
app_name:
description: 'The name of the app to deploy'
required: true
default:
org:
description: 'The org of the app to deploy'
required: true
default:
runs:
using: 'composite'
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2' # Specify your Ruby version here
- name: Install Control Plane CLI
shell: bash
run: |
sudo npm install -g @controlplane/cli
cpln --version
gem install cpl
cpl --version
- name: Set Short SHA
id: vars
shell: bash
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: cpl profile
shell: bash
run: |
cpln profile update default
# Caching step
- uses: actions/cache@v2
with:
path: /tmp/.docker-cache
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile', '**/package.json', '**/yarn.lock') }}
${{ runner.os }}-docker-
- name: cpl setup-app
shell: bash
run: |
if ! cpl exists -a ${{ inputs.app_name }} ; then
cpl setup-app -a ${{ inputs.app_name }}
fi
# Provision all infrastructure on Control Plane.
# app react-webpack-rails-tutorial will be created per definition in .controlplane/controlplane.yml
- name: cpl build-image
shell: bash
run: |
cpln image docker-login
# Use BUILDKIT_PROGRESS=plain to get more verbose logging of the build
# BUILDKIT_PROGRESS=plain cpl build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
cpl build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
# --cache /tmp/.docker-cache
- name: Deploy to Control Plane
shell: bash
run: |
echo "Deploying to Control Plane"
cpl deploy-image -a ${{ inputs.app_name }} --run-release-phase --org ${{inputs.org}} --verbose