-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (62 loc) · 5.46 KB
/
deployment.yml
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: S3 Deployment
on:
workflow_dispatch:
inputs:
version:
description: 'The FormKiQ version number string to deploy.'
required: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: deploy to s3
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
formKiQVersion: ${{ github.event.inputs.version }}
run: |
aws s3 cp s3://${S3_BUCKET}/formkiq-core/formkiq-core-${formKiQVersion}.zip .
unzip formkiq-core*
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-us-east-1 --template-file template.yaml --region us-east-1 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-us-east-1/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-us-east-1/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-us-east-2 --template-file template.yaml --region us-east-2 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-us-east-2/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-us-east-2/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-ca-central-1 --template-file template.yaml --region ca-central-1 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-ca-central-1/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-ca-central-1/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-ca-west-1 --template-file template.yaml --region ca-west-1 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-ca-west-1/${formKiQVersion}/template.yaml --region ca-west-1
aws s3 cp vpc.yaml s3://formkiq-core-distribution-ca-west-1/${formKiQVersion}/vpc.yaml --region ca-west-1
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-eu-central-1 --template-file template.yaml --region eu-central-1 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-eu-central-1/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-eu-central-1/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-ap-south-1 --template-file template.yaml --region ap-south-1 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-ap-south-1/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-ap-south-1/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-us-west-2 --template-file template.yaml --region us-west-2 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-us-west-2/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-us-west-2/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-sa-east-1 --template-file template.yaml --region sa-east-1 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-sa-east-1/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-sa-east-1/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-ap-southeast-2 --template-file template.yaml --region ap-southeast-2 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-ap-southeast-2/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-ap-southeast-2/${formKiQVersion}/vpc.yaml
sam package --s3-prefix ${formKiQVersion} --s3-bucket formkiq-core-distribution-ap-northeast-2 --template-file template.yaml --region ap-northeast-2 --output-template-file template-${formKiQVersion}.yaml
aws s3 cp template-${formKiQVersion}.yaml s3://formkiq-core-distribution-ap-northeast-2/${formKiQVersion}/template.yaml
aws s3 cp vpc.yaml s3://formkiq-core-distribution-ap-northeast-2/${formKiQVersion}/vpc.yaml