-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (45 loc) · 1.53 KB
/
upload-integration-templates.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
name: Upload integration templates
on:
push:
branches:
- main
paths:
# we only want to run this workflow when changes are made to the integrations folder
- integrations/**
pull_request:
# when running the workflow manually upload to stg bucket
workflow_dispatch:
inputs:
bucket_environment:
description: 'Environment to deploy to, either stg or prod'
required: true
default: 'stg-01'
options:
- 'stg-01'
jobs:
upload-templates:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
needs: upload-integrations
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Configure AWS Credentials 🔒
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: resolve the aws s3 bucket name
id: resolve-bucket-name
run: |
if [[ "${{ github.event_name }}" == "push"; then
echo "bucket_name=advance-templates" >> $GITHUB_OUTPUT
else:
echo "bucket_name=advance-templates-${{ github.event.inputs.bucket_environment }}" >> $GITHUB_OUTPUT
fi
- name: Upload specifications to s3
run: aws s3 cp integrations/ "s3://${{ steps.resolve-bucket-name.output.bucket_name }}/integrations" --recursive