Skip to content

Merge pull request #6 from chaitanyakole/dev_issues_fix #7

Merge pull request #6 from chaitanyakole/dev_issues_fix

Merge pull request #6 from chaitanyakole/dev_issues_fix #7

Workflow file for this run

name: S3 Deployment on the ALL-SAAS-DEV
on:
push:
branches:
- all-sass-0.1
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: npm install, build
run: |
if [ -f .env ]; then
rm .env
fi
echo '${{ secrets.DEV_ENV }}' > .env
npm install
npm run build
- name: Show PWD
run: |
echo "Current Working Directory:"
pwd
- name: List Contents (root directory)
run: |
echo "Contents of the current directory (in reverse order):"
ls -lr
- name: List Contents (dist directory)
run: |
echo "Contents of the dist directory (in reverse order):"
ls -lr .next
- name: Install AWS CLI
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region ${{ secrets.AWS_S3_BUCKET_REGION }}
- name: Upload to s3 Bucket
run: |
aws s3 sync .next/ s3://${{ secrets.AWS_S3_BUCKET }}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"