OSDN Git Service

Merge pull request #224 from habu1010/feature/workflow-publishing-spoiler-page
[hengbandforosx/hengbandosx.git] / .github / workflows / publish-spoiler-page.yml
1 name: Publish Spoiler Github Pages
2
3 on:
4   push:
5     branches: [master]
6   # 手動トリガーを許可
7   workflow_dispatch:
8
9 jobs:
10   create_spoilers:
11     name: Create auto generate spoiler files
12     runs-on: ubuntu-20.04
13     steps:
14       - uses: actions/checkout@v2
15
16       - name: Install required packages
17         run: |
18           sudo apt-get update
19           sudo apt-get install \
20             nkf \
21
22       - name: Generate configure
23         run: ./bootstrap
24
25       - name: Configuration for Japanese version
26         run: ./configure --disable-worldscore
27         env:
28           CFLAGS: "-pipe"
29
30       - name: Build Japanese version
31         run: make -j$(nproc)
32
33       - name: Output spoilers
34         run: src/hengband --output-spoilers
35
36       - name: Convert encoding to UTF-8
37         run: nkf -w --in-place ~/.angband/Hengband/*.txt
38
39       - name: Upload spoilers
40         uses: actions/upload-artifact@v2
41         with:
42           name: spoiler-files
43           path: ~/.angband/Hengband/*.txt
44
45
46   publish:
47     name: Publish GitHub Pages of spoilers
48     needs: create_spoilers
49     runs-on: ubuntu-20.04
50     env:
51       GITHUB_PAGES_REPOSITORY: hengband/spoiler
52     steps:
53       - uses: actions/checkout@v2
54         with:
55           repository: ${{ env.GITHUB_PAGES_REPOSITORY }}
56
57       - name: Download spoilers
58         uses: actions/download-artifact@v2
59         with:
60           name: spoiler-files
61           path: spoilers
62
63       - name: Copy spoilers to publish dir
64         run: cp -v spoilers/*.txt docs/
65
66       - name: Deploy
67         uses: peaceiris/actions-gh-pages@v3
68         with:
69           deploy_key: ${{ secrets.SPOILER_REPOSITORY_DEPLOY_KEY }}
70           publish_dir: ./docs
71           external_repository: ${{ env.GITHUB_PAGES_REPOSITORY }}
72           enable_jekyll: true
73           user_name: hengband
74           user_email: hengband@users.noreply.github.com