This repository was archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (71 loc) · 2.36 KB
/
deployment.yml
File metadata and controls
73 lines (71 loc) · 2.36 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
71
72
73
name: Deploy a stage
on:
workflow_call:
inputs:
deployment_stage:
required: true
type: string
secrets:
PULUMI_ACCESS_TOKEN:
required: true
AWS_REGION:
required: true
workflow_dispatch:
inputs:
deployment_stage:
description: Environment where to deploy the stack (dev, staging)
type: environment
required: true
env:
pulumi_stack_organization: virtualfinland
jobs:
build-and-test:
uses: Virtual-Finland-Development/testbed-api/.github/workflows/build-and-test.yml@main
with:
deployment_stage: ${{ inputs.deployment_stage }}
wants_artifacts: true
deploy:
name: Deployment 🔧🏹🧬🌀📡⛅🚀✨
environment: ${{ inputs.deployment_stage }}
runs-on: ubuntu-latest
needs: build-and-test
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Download the built artifact 🐪
uses: actions/download-artifact@v3
with:
name: build-artifact-${{ inputs.deployment_stage }}
path: infra/build
- name: Display structure of downloaded artifact files 🐪🔍
run: |
ls -R infra/build
- name: Setup Python 🪄
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies 📦️
run: pip install -r infra/requirements.txt
- name: Configure AWS credentials 🎲
uses: Virtual-Finland-Development/infrastructure/.github/actions/configure-aws-credentials@main
with:
environment: ${{ inputs.deployment_stage }}
aws-region: ${{ secrets.AWS_REGION }}
pulumi-access-token: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- name: Deploy with Pulumi ✨
uses: pulumi/actions@v4
with:
work-dir: ./infra
command: up
stack-name: ${{ env.pulumi_stack_organization }}/${{ inputs.deployment_stage }}
upsert: true # create stack if no exists
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
- name: Tag the deployment
uses: Virtual-Finland-Development/automatic-release-action@v1.0
if: ${{ inputs.deployment_stage == 'staging' }}
with:
environment: ${{ inputs.deployment_stage }}
githubToken: ${{ secrets.GITHUB_TOKEN }}