Merge branch 'main' of github.com:Bixal/BixalTimeline #2
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
build_push: | |
environment: ${{ github.head_ref || github.ref_name }} | |
runs-on: ubuntu-latest | |
container: | |
image: node:20-alpine3.17 | |
env: | |
AWS_BUCKET: ${{ vars.AWS_BUCKET }} | |
name: Build & deploy | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_DEFAULT_REGION }} | |
- name: Install dependencies | |
run: | | |
apk update | |
apk add --no-cache aws-cli | |
- name: NPM build | |
run: | | |
npm install --legacy-peer-deps | |
npm run build | |
- name: Sync website to S3 | |
run: | | |
cd dist | |
aws s3 sync . s3://${AWS_BUCKET} --delete |