[Bug fix] Chatportal message inconsistency #1
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
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: npm install | |
- name: Create production build | |
run: npm run build | |
env: | |
CI: "" | |
LEAFLET_API_KEY: "${{ secrets.LEAFLET_API_KEY }}" | |
REACT_APP_BASEURL: "${{ secrets.REACT_APP_BASEURL }}" | |
REACT_APP_SOCKET_BASEURL: "${{ secrets.REACT_APP_SOCKET_BASEURL }}" | |
REACT_APP_LOCATION_IQ_API_KEY: "${{ secrets.REACT_APP_LOCATION_IQ_API_KEY }}" | |
- name: Share artifact inside workflow | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sportflix-build | |
path: build | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Downloading Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: sportflix-build | |
path: sportflix_build | |
# - name: Show files | |
# run: ls -R | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Deploy static site to S3 bucket | |
run: aws s3 sync ./sportflix_build/ s3://${{ secrets.AWS_BUCKET }} --delete | |
- name: Invalidate cloudfront cache | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/*" |