-
Notifications
You must be signed in to change notification settings - Fork 23
80 lines (70 loc) · 2.48 KB
/
rw-deploy.yaml
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
74
75
76
77
78
79
80
name: rw-deploy
on:
workflow_call:
inputs:
job-environment:
required: true
type: string
sceptre-suffix:
required: true
type: string
tower-url:
required: true
type: string
aws-role-to-assume:
required: true
type: string
aws-assume-role-duration:
required: false
type: number
default: 3600
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.job-environment }}
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pipenv'
- name: Install python pipenv
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
- name: Install python dependencies
run: pipenv install --dev
- name: Assume AWS role
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-1
role-to-assume: ${{ inputs.aws-role-to-assume }}
role-session-name: GHA-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }}
role-duration-seconds: ${{ inputs.aws-assume-role-duration }}
- name: Deploy common configuration
run: >
pipenv run sceptre --var-file=src/sceptre/variables/${{ inputs.sceptre-suffix }}.yaml
launch common --yes --prune
- name: Deploy infrastructure configuration
run: >
pipenv run sceptre --var-file=src/sceptre/variables/${{ inputs.sceptre-suffix }}.yaml
launch infra-${{ inputs.sceptre-suffix }} --yes --prune
- name: Deploy projects configuration
run: >
pipenv run sceptre --var-file=src/sceptre/variables/${{ inputs.sceptre-suffix }}.yaml
launch projects-${{ inputs.sceptre-suffix }} --yes --prune
- name: Wait for Nextflow Tower to be up
uses: nev7n/wait_for_response@v1
with:
url: ${{ inputs.tower-url }}
responseCode: 200
timeout: 1800000 # 30 minutes
interval: 30000 # 30 seconds
- name: Configure projects in Tower
run: pipenv run bin/configure-tower-projects.py config/projects-${{ inputs.sceptre-suffix }}
env:
NXF_TOWER_TOKEN: ${{ secrets.TOWER_TOKEN }}
NXF_TOWER_API_URL: ${{ inputs.tower-url }}/api