|
1 | 1 | name: Deploy |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | | - branches: [ main ] |
6 | | - |
| 4 | + branches: [main] |
7 | 5 | jobs: |
8 | 6 | build: |
9 | 7 | runs-on: ubuntu-latest |
10 | | - |
11 | 8 | steps: |
12 | | - - name: Checkout |
13 | | - uses: actions/checkout@v2.3.4 |
14 | | - - name: Setup Node.js environment |
15 | | - uses: actions/setup-node@main |
16 | | - with: |
17 | | - node-version: '15.x' |
18 | | - - name: Set up Python 3.9 |
19 | | - uses: actions/setup-python@v1 |
20 | | - with: |
21 | | - python-version: 3.9 |
22 | | - - name: Install dependencies |
23 | | - run: | |
24 | | - python -m pip install --upgrade pip |
25 | | - python -m pip install PyYAML jsonschema icalendar xlin |
26 | | - - name: Validate yml files |
27 | | - run: | |
28 | | - python ./scripts/validate |
29 | | - - name: Assemble yml files |
30 | | - run: | |
31 | | - mkdir -p public/conference && cd public/conference |
32 | | - awk 1 `find ../../conference -name '*.yml' -not -path '**/types.yml'` > allconf.yml |
33 | | - awk 1 `find ../../accept_rates -name '*.yml'` > allacc.yml |
34 | | - cp ../../conference/types.yml . |
35 | | - cd ../.. |
36 | | - - name: Generate iCal files |
37 | | - run: | |
38 | | - python cli/ccfddl/convert_to_ical.py |
39 | | - mv *.ics public/conference/ |
40 | | - - name: Get yarn cache directory path |
41 | | - id: yarn-cache-dir-path |
42 | | - run: echo "::set-output name=dir::$(yarn cache dir)" |
43 | | - - uses: actions/cache@v4 |
44 | | - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |
45 | | - with: |
46 | | - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
47 | | - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
48 | | - restore-keys: | |
49 | | - ${{ runner.os }}-yarn- |
50 | | - - name: Install dependency and build |
51 | | - run: | |
52 | | - yarn config set strict-ssl false |
53 | | - yarn install |
54 | | - yarn build |
55 | | - - name: Config Git |
56 | | - run: | |
57 | | - git config --global user.email "me@4f5da2.com" |
58 | | - git config --global user.name "0x4f5da2" |
59 | | - - name: Deploy |
60 | | - run: | |
61 | | - cd dist |
62 | | - echo 'ccfddl.com' > CNAME |
63 | | - git init |
64 | | - git add --all |
65 | | - git commit -m "Site Update:`TZ=':Asia/Shanghai' date +' %Y-%m-%d %H:%m:%S'`" |
66 | | - git push --force https://${{ secrets.ACCESS_TOKEN }}@github.com/ccfddl/ccfddl.github.io.git master:page |
| 9 | + - name: Checkout |
| 10 | + uses: actions/checkout@v2.3.4 |
| 11 | + - name: Setup Node.js environment |
| 12 | + uses: actions/setup-node@main |
| 13 | + with: |
| 14 | + node-version: '15.x' |
| 15 | + - name: Set up Python 3.9 |
| 16 | + uses: actions/setup-python@v1 |
| 17 | + with: |
| 18 | + python-version: 3.9 |
| 19 | + - name: Install dependencies |
| 20 | + run: | |
| 21 | + python -m pip install --upgrade pip |
| 22 | + python -m pip install PyYAML jsonschema icalendar xlin |
| 23 | + - name: Assemble yml files |
| 24 | + run: | |
| 25 | + mkdir -p public/conference && cd public/conference |
| 26 | + awk 1 `find ../../conference -name '*.yml' -not -path '**/types.yml'` > allconf.yml |
| 27 | + awk 1 `find ../../accept_rates -name '*.yml'` > allacc.yml |
| 28 | + cp ../../conference/types.yml . |
| 29 | + cd ../.. |
| 30 | + - name: Generate iCal files |
| 31 | + run: | |
| 32 | + python cli/ccfddl/convert_to_ical.py |
| 33 | + mv *.ics public/conference/ |
| 34 | + - name: Get yarn cache directory path |
| 35 | + id: yarn-cache-dir-path |
| 36 | + run: echo "::set-output name=dir::$(yarn cache dir)" |
| 37 | + - uses: actions/cache@v4 |
| 38 | + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |
| 39 | + with: |
| 40 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 41 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 42 | + restore-keys: | |
| 43 | + ${{ runner.os }}-yarn- |
| 44 | + - name: Install dependency and build |
| 45 | + run: | |
| 46 | + yarn config set strict-ssl false |
| 47 | + yarn install |
| 48 | + yarn build |
| 49 | + - name: Config Git |
| 50 | + run: | |
| 51 | + git config --global user.email "me@4f5da2.com" |
| 52 | + git config --global user.name "0x4f5da2" |
| 53 | + - name: Deploy |
| 54 | + run: | |
| 55 | + cd dist |
| 56 | + echo 'ccfddl.com' > CNAME |
| 57 | + git init |
| 58 | + git add --all |
| 59 | + git commit -m "Site Update:`TZ=':Asia/Shanghai' date +' %Y-%m-%d %H:%m:%S'`" |
| 60 | + git push --force https://${{ secrets.ACCESS_TOKEN }}@github.com/ccfddl/ccfddl.github.io.git master:page |
0 commit comments