Merge branch 'Fix/#34/PrivateRoute' of https://github.com/TWC-codeit/… #20
This file contains hidden or 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: DEV CICD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| Deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| - name: Cache node modules | |
| uses: actions/cache@v3 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.OS }}-build- | |
| ${{ runner.OS }}- | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Set Environment Variables | |
| run: | | |
| echo "VITE_APP_API_URL=${{ secrets.VITE_APP_API_URL }}" >> .env | |
| - name: Check .env file | |
| run: cat .env || echo ".env file not found" | |
| - name: Check assets folder | |
| run: ls -la src/assets/source/ | |
| - name: Build | |
| run: npm run build | |
| - name: Check if dist directory exists | |
| run: ls -la ./dist | |
| - 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: ${{ secrets.AWS_REGION }} | |
| - name: Deploy to S3 | |
| run: aws s3 sync ./dist s3://${{ secrets.AWS_BUCKET_NAME }} --delete |