Skip to content

Commit 647f7b9

Browse files
committed
Refactor ini-cloud-aws to be cloud agnostic
1 parent 739304e commit 647f7b9

File tree

2 files changed

+15
-27
lines changed

2 files changed

+15
-27
lines changed
Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
name: init-cloud-aws
1+
name: init-cloud
22
description: "Initialize Nebari config for cloud deployment"
33

44
inputs:
55
directory:
66
description: "Path to directory to initialize in"
77
required: false
8-
default: './aws-deployment'
9-
aws_region:
10-
description: "AWS region to use for deployment"
11-
required: false
12-
default: 'us-west-2'
13-
aws_role_to_assume:
14-
description: "ARN of AWS role to assume for deployment"
8+
default: './cloud-deployment'
9+
cloud:
10+
description: "Cloud provider to use for deployment"
1511
required: true
1612

1713
outputs:
@@ -46,21 +42,14 @@ runs:
4642
PROJECT='github-actions'
4743
echo "project=${PROJECT}" | tee --append "${GITHUB_OUTPUT}"
4844
49-
DOMAIN='ci-aws.nebari.dev'
45+
DOMAIN='ci-${{ inputs.cloud }}.nebari.dev'
5046
echo "domain=${DOMAIN}" | tee --append "${GITHUB_OUTPUT}"
5147
52-
- name: Authenticate to AWS
53-
uses: aws-actions/configure-aws-credentials@v1
54-
with:
55-
role-to-assume: ${{ inputs.aws_role_to_assume }}
56-
role-session-name: github-action
57-
aws-region: ${{ inputs.aws_region }}
58-
5948
- shell: bash -l {0}
6049
id: init
6150
working-directory: ${{ steps.metadata.outputs.directory }}
6251
run: |
63-
nebari init aws \
52+
nebari init ${{ inputs.cloud }} \
6453
--project-name '${{ steps.metadata.outputs.project }}' \
6554
--domain-name '${{ steps.metadata.outputs.domain }}' \
6655
--auth-provider password \

.github/workflows/test_aws_integration.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,25 @@ jobs:
6363
pip install .[dev]
6464
playwright install
6565
66+
- name: Authenticate to AWS
67+
uses: aws-actions/configure-aws-credentials@v1
68+
with:
69+
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
70+
role-session-name: github-action
71+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
72+
6673
- name: Initialize Nebari config for aws deployment
6774
id: init
68-
uses: ./.github/actions/init-cloud-aws
75+
uses: ./.github/actions/init-cloud
6976
with:
70-
aws_region: ${{ env.AWS_DEFAULT_REGION }}
71-
aws_role_to_assume: ${{ secrets.AWS_ROLE_ARN }}
77+
cloud: aws
7278

7379
- name: Deploy Nebari
7480
working-directory: ${{ steps.init.outputs.directory }}
7581
run: nebari deploy --config ${{ steps.init.outputs.config }} --disable-prompt
7682
env:
7783
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
7884

79-
- name: Authenticate to AWS
80-
uses: aws-actions/configure-aws-credentials@v1
81-
with:
82-
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
83-
role-session-name: github-action
84-
aws-region: ${{ env.AWS_DEFAULT_REGION }}
85-
8685
- name: Update kube config
8786
run: aws eks update-kubeconfig --name github-actions-dev --region ${{ env.AWS_DEFAULT_REGION }}
8887

0 commit comments

Comments
 (0)