dodavanje 2.txt fajla #48
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
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 |