S3 Deployment #217
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
# 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-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 |