-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: AWS Assume Role via OIDC and S3 Deployment
on:
push:
branches:
- milos_branch
repositories:
- milosjovovic/milos_repo
jobs:
assume-role-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
# Direct AWS Credentials Configurationnnnn
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Set up AWS OIDC authentication
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: arn:aws:iam::630388463273:role/Github_s3_access_jovovic-bucket
role-session-name: GitHubActionsSession
role-duration-seconds: 1200
audience: sts.amazonaws.com
- name: Install AWS CLI
run: |
sudo apt-get update
sudo apt-get install -y awscli
- name: Deploy to S3
run: aws s3 sync ./public/ s3://jovovic-bucket --delete
- name: Call sts get-caller-identity
run: aws sts get-caller-identity