Skip to content

Commit b2790ff

Browse files
authored
Merge pull request #16 from ThuyNT13/github-actions
add GitHub actions
2 parents c0333ac + b4c6819 commit b2790ff

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed

.github/workflows/aws.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to S3
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write # required for requesting the JWT for OpenID Connect (OIDC)
10+
contents: read # required for actions/checkout
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-slim
15+
environment: production
16+
17+
env:
18+
AWS_REGION : us-east-1
19+
20+
steps:
21+
- name: Git checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: configure AWS credentials
25+
uses: aws-actions/configure-aws-credentials@v4
26+
with:
27+
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/GitHubActions
28+
role-session-name: ${{ github.event.repository.name }}-${{ github.run_id }}
29+
aws-region: ${{ env.AWS_REGION }}
30+
31+
- name: sync to AWS S3
32+
run: |
33+
aws s3 sync . s3://${{ vars.S3_BUCKET }} \
34+
--delete \
35+
--exact-timestamps \
36+
--exclude ".aws/*" \
37+
--exclude ".git/*" \
38+
--exclude ".github/*" \
39+
--exclude "README.md" \
40+
--exclude "LICENSE"

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)