-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cicd: replaced composite action with it's steps for deploy-test job
- Loading branch information
Showing
1 changed file
with
93 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,13 +117,100 @@ jobs: | |
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- id: deploy-infrastructure-test | ||
name: Deploy Infrastructure | ||
uses: ./.github/actions/deploy_infrastructure | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache | ||
shell: bash | ||
run: | | ||
python -m pip install pip --upgrade | ||
echo "PIP_CACHE_DIR=$(python -m pip cache dir)" >> $GITHUB_ENV | ||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.PIP_CACHE_DIR }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Configure GCP Credentials | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
workload_identity_provider: "projects/734798842681/locations/global/workloadIdentityPools/my-pool/providers/gh-provider" | ||
service_account: "[email protected]" | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
environment: test | ||
pulumi-version: 3.121.0 | ||
pulumi-stack-passphrase: test | ||
role-to-assume: arn:aws:iam::162277344632:role/CeruleanCloudDeploy | ||
aws-region: eu-central-1 | ||
|
||
- name: Configure docker | ||
shell: bash | ||
run: | | ||
gcloud auth configure-docker -q | ||
- name: Install Pulumi requirements | ||
shell: bash | ||
run: | | ||
pip install -r requirements-pulumi.txt | ||
- name: Build Container Images | ||
uses: pulumi/actions@v5 | ||
id: pulumi-images | ||
env: | ||
PULUMI_CONFIG_PASSPHRASE: "test" | ||
with: | ||
pulumi-version: "3.121.0" | ||
work-dir: images/ | ||
command: up | ||
stack-name: "test" | ||
|
||
- name: Prune Docker environment | ||
shell: bash | ||
run: | | ||
docker container prune -f | ||
docker buildx prune -f | ||
docker images | ||
# Copy shared database_client.py files | ||
- name: Copy Shared File | ||
shell: bash | ||
run: | | ||
mkdir -p cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/ | ||
cp cerulean_cloud/database_client.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/database_client.py | ||
cp cerulean_cloud/database_schema.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/database_schema.py | ||
cp cerulean_cloud/__init__.py cerulean_cloud/cloud_function_ais_analysis/cerulean_cloud/__init__.py | ||
- name: Deploy Infrastructure | ||
uses: pulumi/actions@v5 | ||
id: pulumi | ||
env: | ||
PULUMI_CONFIG_PASSPHRASE: "test" | ||
MODEL: ${{ steps.pulumi-images.outputs.model }} | ||
with: | ||
pulumi-version: "3.121.0" | ||
command: up | ||
stack-name: "test" | ||
refresh: true | ||
diff: true | ||
comment-on-summary: true | ||
|
||
- name: Start Google Cloud SQL Proxy | ||
uses: wagnerpereira/gce-cloudsql-proxy-action@v2 | ||
with: | ||
instance: ${{ steps.pulumi.outputs.database_instance_name }} | ||
|
||
- name: Run database migrations | ||
shell: bash | ||
env: | ||
DB_URL: ${{ steps.pulumi.outputs.database_url_alembic }} | ||
run: | | ||
pip install -r requirements.txt && alembic upgrade head | ||
deploy-staging: | ||
name: Deploy [STAGING] | ||
|