Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlinchen committed Sep 10, 2020
1 parent 6846aa6 commit 50a06c7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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]>"
Expand Down
43 changes: 43 additions & 0 deletions README.md
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'
```

0 comments on commit 50a06c7

Please sign in to comment.