Skip to content

security(deps-tree): update postcss to v8.4.31 [security] #842

security(deps-tree): update postcss to v8.4.31 [security]

security(deps-tree): update postcss to v8.4.31 [security] #842

Workflow file for this run

# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# Workflows commands (::set-output, etc): # https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter
name: Test, Build, and Deploy βš™βš›βœ¨πŸš€
on:
push:
branches: [main, dicoding]
pull_request:
branches: [main]
jobs:
test_build:
name: Test and Build βš™βš›
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x, 14.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/[email protected]
- name: Use NodeJS ${{ matrix.node }} πŸ“¦
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Get Yarn Cache Directory Path 🐈
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Cache Directories 🧢
uses: actions/[email protected]
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
${{ github.workspace }}/node_modules/.cache
~/.cache/ms-playwright
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies ✨
run: yarn install --immutable --check-cache
- name: Run Linter πŸ‘¨πŸ»β€πŸ’»
run: yarn type-check && yarn lint
- name: Run Formatter πŸ’…
run: yarn format
- name: Run Test πŸ› 
run: yarn test
- name: Run E2E Test πŸ‘₯πŸ§ͺ
if: matrix.node-version == '14.x'
run: yarn test:e2e
- name: Run Build βš™
run: yarn build
- name: Cache build ready to deploy πŸš€
uses: actions/[email protected]
with:
path: |
./dist
key: ${{ github.sha }}-${{ runner.os }}-${{ matrix.node-version }}
deploy:
name: Deploy to production βœ¨πŸš€
needs: test_build
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dicoding'
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/[email protected]
- name: Restore build cache ♻️
uses: actions/[email protected]
with:
path: |
./dist
key: ${{ github.sha }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Deploy πŸš€
if: github.ref == 'refs/heads/main'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
cname: aladine.latipun.dev
- name: Deploy πŸš€
if: github.ref == 'refs/heads/dicoding'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: github-pages-dicoding