-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an updated actions workflow file for deploying the frontend files to an s3 bucket for static website hosting.
- Loading branch information
Showing
1 changed file
with
12 additions
and
17 deletions.
There are no files selected for viewing
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
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 }} |