Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
This is an updated actions workflow file for deploying the frontend files to an s3 bucket for static website hosting.
  • Loading branch information
emgeier authored Oct 17, 2024
1 parent a6758d3 commit 7349ff0
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
name: ci
name: Deploy to S3

on:
push:
branches:
- 'build'
- 'staticSite' # Trigger the workflow on push to the branch

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
id-token: write
contents: read

jobs:
init:
deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository code
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

# Step 2: Configure AWS credentials
- name: Configure AWS credentials from AWS account
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}
role-session-name: GitHub-OIDC-frontend

- name: Run script to change files, build docker and push to ECR
# Step 3: Sync files to S3 for static website hosting
- name: Sync files to S3
run: |
build/workflow.sh
aws s3 sync ./ s3://srophe-syriaca-front-end --delete
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ADMIN_PASSWORD: ${{secrets.ADMIN_PASSWORD}}
ECR_REPOSITORY: ${{secrets.ECR_REPOSITORY}}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 7349ff0

Please sign in to comment.