Skip to content

remove unwanted log statements #58

remove unwanted log statements

remove unwanted log statements #58

Workflow file for this run

name: Build static, apply formatter, deploy on production
on: [push]
jobs:
build-production:
name: Build static
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Configure Git
run: |
git config --global user.email "me@kefan.me"
git config --global user.name "Kevin Dong"
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 18.15.0
- name: Install Node.js dependencies
run: npm ci
- name: Rebuild the directory
run: npm run build
- name: Check if there is any new translations
id: verify_diff
run: git diff --quiet dist || echo "new_build_exist=true" >> $GITHUB_OUTPUT
- name: Commit changes
if: steps.verify_diff.outputs.new_build_exist == 'true'
run: |
timestamp=$(date +'%Y%m%d%H%M%S')
git add dist
git commit -m "update dist folder - $timestamp"
- name: Push changes
if: steps.verify_diff.outputs.new_build_exist == 'true'
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
run-linters:
name: Format with Prettier and Black
needs: build-production
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Configure Git
run: |
git config --global user.email "me@kefan.me"
git config --global user.name "Kevin Dong"
- name: Pull latest changes
run: git pull
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.15.0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup formatters
run: |
pip install black
npm install --no-save prettier
- name: Run linters
run: |
black app/
npx prettier --write src/
- name: Check if there is any new translations
id: verify_diff
run: git diff --quiet || echo "formatter_changes_exist=true" >> $GITHUB_OUTPUT
- name: Commit changes
if: steps.verify_diff.outputs.formatter_changes_exist == 'true'
run: |
timestamp=$(date +'%Y%m%d%H%M%S')
git add app/* src/*
git commit -m "Format fix"
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}