forked from ChenCMD/datapack-linter
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 1.91 KB
/
lint-datapack-dev.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Test run and Deploy to dist branch
on:
push:
branches-ignore:
- dist
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-run-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout dist branch
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/checkout@v3
with:
ref: dist
path: ./dist
- name: Cache Node dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-deps-${{ hashFiles('./yarn.lock') }}
- name: Cache SBT dependencies
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.ivy2/local/org.scalablytyped
./target/scala-*/scalajs-bundler/node_modules
key: ${{ runner.os }}-sbt-deps-${{ hashFiles('./build.sbt') }}
- name: Install Node dependencies
run: yarn install
- name: Build for production
run: yarn build
- name: Export environments
uses: peaceiris/[email protected]
id: envs
- name: Run
run: yarn test-run
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.envs.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_CACHE_URL: ${{ steps.envs.outputs.ACTIONS_CACHE_URL }}
- name: Pre deploy
if: ${{ github.ref == 'refs/heads/main' }}
run: cp action.yml LICENSE README.md .gitignore dist
- name: Deploy to dist
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dist
directory: ./dist
empty: true
message: Compiled from ${{ github.SHA }}