-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6846aa6
commit 50a06c7
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ LABEL "com.github.actions.description"="This action deploys your AWS Amplify pul | |
LABEL "com.github.actions.icon"="git-commit" | ||
LABEL "com.github.actions.color"="blue" | ||
|
||
LABEL version="0.2" | ||
LABEL "repository"="https://github.com/yinlinchen/amplify-preview-actions.git" | ||
LABEL "homepage"="https://github.com/yinlinchen/amplify-preview-actions" | ||
LABEL maintainer="Yinlin Chen <[email protected]>" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,45 @@ | ||
# amplify-preview-actions | ||
|
||
[![RELEASE](https://img.shields.io/github/v/release/yinlinchen/amplify-preview-actions?include_prereleases)](https://github.com/ambientlight/amplify-cli-action/releases) | ||
[![LICENSE](https://img.shields.io/github/license/yinlinchen/amplify-preview-actions)](https://github.com/yinlinchen/amplify-preview-actions/blob/master/LICENSE) | ||
[![ISSUES](https://img.shields.io/github/issues/yinlinchen/amplify-preview-actions)](https://github.com/yinlinchen/amplify-preview-actions/issues) | ||
|
||
AWS Amplify pull request preview currently only supports private github repositoy. This action deploys your AWS Amplify pull request preview for your public repository. | ||
|
||
## Getting Started | ||
You can include the action in your workflow as `actions/[email protected]`. | ||
|
||
Example: | ||
|
||
```yaml | ||
name: 'Amplify PR Preview' | ||
on: | ||
pull_request: | ||
types: [review_requested] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: set branchname env | ||
id: setenvname | ||
run: | | ||
# use GITHUB_HEAD_REF that is set to PR source branch | ||
# also remove -_ from branch name and limit length to 10 for amplify env restriction | ||
echo "##[set-output name=setbranchname;]$(echo ${GITHUB_HEAD_REF//[-_]/} | cut -c-10)" | ||
- name: deploy PR preview | ||
uses: yinlinchen/[email protected] | ||
with: | ||
branch_name: ${{ steps.setenvname.outputs.setbranchname }} | ||
aws_cli_version: '1.18.135' | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AmplifyAppId: ${{ secrets.AmplifyAppId }} | ||
BackendEnvARN: ${{ secrets.BackendEnvARN }} | ||
AWS_REGION: 'us-east-1' | ||
``` | ||