-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 1.58 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CI Workflow
on:
push:
branches:
- master
pull_request:
defaults:
run:
shell: bash
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up reviewdog
uses: reviewdog/action-setup@v1
- name: Set up .env
run: cp .env{.example,}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v6
id: build
with:
context: .
target: build
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
build-args: |
CI
- name: Run eslint
if: ${{ always() && steps.build.conclusion == 'success' }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cwd=$(docker run --rm ${{ steps.build.outputs.imageid }} pwd)
docker run --rm ${{ steps.build.outputs.imageid }} yarn lint:js |
sed "s!$cwd/!!g" |
reviewdog -f=eslint -reporter=github-pr-annotations -filter-mode=nofilter -fail-on-error -tee
- name: Run stylelint
if: ${{ always() && steps.build.conclusion == 'success' }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker run --rm ${{ steps.build.outputs.imageid }} yarn lint:css 2>&1 |
reviewdog -f=stylelint -reporter=github-pr-annotations -filter-mode=nofilter -fail-on-error -tee