1.6.0 #17
Workflow file for this run
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: Main | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
env: | |
CI: false | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install | |
- name: Lint | |
run: yarn run lint | |
- name: build | |
run: yarn run build | |
deploy: | |
name: Deploy to production | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn | |
- name: Build | |
run: yarn build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_QUOTES_JUFFALOW_COM_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_QUOTES_JUFFALOW_COM_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_CONTAINER_REGISTRY_REGION }} | |
- name: Sync build folder with S3 | |
run: aws s3 sync ./build s3://juffalow-my-projects/quotes-juffalow-com | |
- name: Invalidate CloudFront cache | |
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |