readme update - sonarcloud project badge #15
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: Build, Lint, Test and Deploy to Netlify | |
on: | |
push: | |
branches: [v1.1-api] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Install Dependencies | |
run: npm install | |
- name: Lint | |
run: npx eslint . --ext .js,.jsx,.ts,.tsx | |
- name: Run Tests | |
run: npm test | |
- name: Build | |
run: npm run build | |
- name: Build Docker Image | |
run: docker build -t ghcr.io/romanprotoliuk/yoga-app-front-end:$GITHUB_SHA . | |
- name: Login to GitHub Container Registry | |
run: echo ${{ secrets.GHCR_PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push Docker Image to GitHub Packages | |
run: docker push ghcr.io/romanprotoliuk/yoga-app-front-end:$GITHUB_SHA | |
- name: Deploy to Netlify | |
if: github.ref == 'refs/heads/v1.1-api' && github.event_name == 'push' | |
uses: netlify/actions/cli@master | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
with: | |
args: deploy --dir=build --prod |