Reuse env var #14
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: Deploy to AWS S3 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install and Build | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- 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: ap-northeast-1 | |
- name: Deploy static site to S3 bucket | |
run: | | |
touch .env | |
echo VITE_AWS_REGION=${{ secrets.AWS_REGION }} >> .env | |
echo VITE_QUEUE_URL=${{ secrets.QUEUE_URL }} >> .env | |
echo VITE_FUNCTION_NAME=${{ secrets.FUNCTION_NAME }} >> .env | |
echo VITE_IDENTITY_POOL=${{ secrets.IDEDNTITY_POOL_ID }} >> .env | |
echo VITE_BATCH_BUCKET=${{ secrets.S3_BATCH_BUCKET }} >> .env | |
npm install | |
npm run build | |
pushd dist | |
aws s3 sync . s3://audioctxai.com --delete --sse AES256 --cache-control no-cache | |
popd | |
rm -rf node_modules package-log.json dist |