Skip to content

Update main.yml

Update main.yml #17

Workflow file for this run

name: My first CI/CD Script
on:
push:
branches:
- master
jobs:
deploy-frontend:
runs-on : ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- 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_KEY}}
aws-region: us-east-1
- name: Change directory to frontend
run : cd frontend
- name: Install dependancy
run: npm ci
- name: Create .env for frontend
run :
echo "VITE_OMDB_API_KEY=${{VITE_OMDB_API_KEY}}" > .env

Check failure on line 26 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / My first CI/CD Script

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 26, Col: 8): Unrecognized named-value: 'VITE_OMDB_API_KEY'. Located at position 1 within expression: VITE_OMDB_API_KEY
echo "VITE_FIREBASE_API=${{VITE_FIREBASE_API}}" > .env
working-directory : ./frontend
- name : Build
run : npm run build
working-directory: ./frontend
- name: push to production
run : aws s3 sync ./dist s3://${{secrets.AWS_S3_BUCKET}}
working-directory: ./frontend
- name: CloudFront invalidation
run : aws cloudfront create-invalidation --distribution-id=${{secrets.DISTRIBUTION_ID}} --path="/*"