Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions aws-amplify-deployment/action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# set amplify branch from git branch if not defined
if [ -z "$AMPLIFY_BRANCH" ]; then
AMPLIFY_BRANCH=$(basename $GITHUB_REF)
fi

# source url
if [ -z "$AMPLIFY_SOURCE_URL" ]; then
AMPLIFY_SOURCE_URL="$AMPLIFY_BUCKET/$GITHUB_REPOSITORY/$AMPLIFY_BRANCH/$GITHUB_SHA.zip"
fi

cd $AMPLIFY_DIST_PATH
zip -r $GITHUB_SHA.zip *
aws s3 cp $GITHUB_SHA.zip $AMPLIFY_SOURCE_URL

aws amplify start-deployment --app-id $AMPLIFY_APP_ID --branch-name $AMPLIFY_BRANCH --source-url $AMPLIFY_SOURCE_URL
29 changes: 29 additions & 0 deletions aws-amplify-deployment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'aws-amplify-deployment'
description: 'Deploys your AWS Amplify project using GitHub Actions.'
branding:
icon: 'cloud'
color: 'orange'
inputs:
amplify-app-id:
description: 'The unique ID for an Amplify app.'
required: true
amplify-bucket:
description: 'The artifacts S3 bucket.'
required: true
amplify-branch:
description: 'The name for the branch, for the job.'
required: false
amplify-dist-path:
description: 'Application build path.'
required: false
default: './public'
runs:
using: "composite"
steps:
- run: ${{ github.action_path }}/action.sh
shell: bash
env:
AMPLIFY_APP_ID: ${{ inputs.amplify-app-id }}
AMPLIFY_BUCKET: ${{ inputs.amplify-bucket }}
AMPLIFY_BRANCH: ${{ inputs.amplify-branch }}
AMPLIFY_DIST_PATH: ${{ inputs.amplify-dist-path }}