Skip to content

Commit 058322d

Browse files
committed
chore(docs): add example of using aws cli
1 parent 18a20df commit 058322d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,30 @@ Add the following step to your workflow:
1515
aws-region: us-east-2
1616
```
1717
18+
For example, you can use this action with the AWS CLI available in [GitHub's hosted virtual environments](https://help.github.com/en/actions/reference/software-installed-on-github-hosted-runners).
19+
20+
```
21+
jobs:
22+
deploy:
23+
name: Upload to Amazon S3
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Configure AWS credentials
31+
uses: aws-actions/configure-aws-credentials@v1
32+
with:
33+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
34+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35+
aws-region: us-east-2
36+
37+
- name: Copy files to S3 with the AWS CLI
38+
run: |
39+
aws s3 sync . s3://my-s3-website-bucket
40+
```
41+
1842
See [action.yml](action.yml) for the full documentation for this action's inputs and outputs.
1943
2044
## Credentials
@@ -28,7 +52,7 @@ We recommend following [Amazon IAM best practices](https://docs.aws.amazon.com/I
2852
2953
## Assuming a role
3054
If you would like to use the credentials you provide to this action to assume a role, you can do so by specifying the role ARN in `role-to-assume`.
31-
The role credentials will then be output instead of the ones you have provided.
55+
The role credentials will then be output instead of the ones you have provided.
3256
The default session duration is 6 hours, but if you would like to adjust this you can pass a duration to `role-duration-seconds`.
3357

3458
Example:
@@ -44,7 +68,7 @@ Example:
4468
```
4569

4670
### Session tagging
47-
The session will have the name "GitHubActions" and be tagged with the following tags:
71+
The session will have the name "GitHubActions" and be tagged with the following tags:
4872
(`GITHUB_` environment variable definitions can be [found here](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables))
4973

5074
| Key | Value|

0 commit comments

Comments
 (0)