|
1 | | -name: build |
| 1 | +name: deploy |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ master ] |
| 5 | + branches: [master] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + pages: write |
| 10 | + id-token: write |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: "pages" |
| 14 | + cancel-in-progress: false |
6 | 15 |
|
7 | 16 | jobs: |
8 | 17 | build: |
9 | 18 | runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - uses: actions/configure-pages@v5 |
| 22 | + - uses: actions/jekyll-build-pages@v1 |
| 23 | + with: |
| 24 | + source: ./ |
| 25 | + destination: ./_site |
| 26 | + - uses: actions/upload-pages-artifact@v3 |
10 | 27 |
|
| 28 | + deploy: |
| 29 | + environment: |
| 30 | + name: github-pages |
| 31 | + url: ${{ steps.deployment.outputs.page_url }} |
| 32 | + runs-on: ubuntu-latest |
| 33 | + needs: build |
11 | 34 | steps: |
12 | | - - uses: actions/checkout@v2 |
13 | | - with: |
14 | | - persist-credentials: false |
15 | | - fetch-depth: 0 |
16 | | - - name: git fetch |
17 | | - run: git fetch |
18 | | - - name: checkout www |
19 | | - run: git checkout -t origin/www |
20 | | - - name: ensure pull |
21 | | - run: git pull |
22 | | - - name: return to master |
23 | | - run: git checkout master |
24 | | - - name: Install leiningen |
25 | | - run: wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein && chmod +x lein && sudo mv lein /usr/local/bin/lein |
26 | | - - name: Install dependencies |
27 | | - run: lein deps |
28 | | - - name: Build site |
29 | | - run: ./build.sh https://sourceless.org |
30 | | - - name: git reset www |
31 | | - run: git reset www |
32 | | - - name: delete non-dist folders |
33 | | - run: ls | grep -v dist | xargs rm -r |
34 | | - - name: pull contents out of dist |
35 | | - run: cp -r dist/* . |
36 | | - - name: delete unused stuff |
37 | | - run: | |
38 | | - rm -r dist |
39 | | - rm -r .github |
40 | | - - name: git add . |
41 | | - run: git add . |
42 | | - - name: checkout www |
43 | | - run: git checkout www |
44 | | - - name: git status |
45 | | - run: git status |
46 | | - - name: Set git user |
47 | | - run: | |
48 | | - git config --local user.email "bot@sourceless.org" |
49 | | - git config --local user.name "Site Builder Bot" |
50 | | - - name: commit |
51 | | - run: git commit -m "www-build-$GITHUB_RUN_NUMBER" |
52 | | - - name: Push changes |
53 | | - uses: ad-m/github-push-action@master |
54 | | - with: |
55 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
56 | | - branch: www |
| 35 | + - name: Deploy to GitHub Pages |
| 36 | + id: deployment |
| 37 | + uses: actions/deploy-pages@v4 |
0 commit comments