-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathaction.yml
More file actions
56 lines (48 loc) · 1.89 KB
/
action.yml
File metadata and controls
56 lines (48 loc) · 1.89 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
# 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
org:
description: 'The org of the app to deploy'
required: true
runs:
using: 'composite'
steps:
- name: Setup Environment
uses: ./.github/actions/setup-environment
- name: Set Short SHA
id: vars
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
# Updated caching step to v3
- uses: actions/cache@v3
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: cpflow setup-app
shell: bash
run: |
if ! cpflow exists -a ${{ inputs.app_name }} ; then
cpflow 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: cpflow build-image
shell: bash
run: |
cpln image docker-login
# Use BUILDKIT_PROGRESS=plain to get more verbose logging of the build
# BUILDKIT_PROGRESS=plain cpflow build-image -a ${{ inputs.app_name }} --commit ${{steps.vars.outputs.sha_short}} --org ${{inputs.org}}
cpflow build-image -a ${{ inputs.app_name }} --commit=${{steps.vars.outputs.sha_short}} --org=${{inputs.org}}
- name: Deploy to Control Plane
shell: bash
run: |
echo "Deploying to Control Plane"
cpflow deploy-image -a ${{ inputs.app_name }} --run-release-phase --org ${{inputs.org}} --verbose