Skip to content

Commit 4ba650e

Browse files
committed
Hopefully workflow will behave good now?
1 parent b90e010 commit 4ba650e

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

.github/workflows/build_and_deploy.yml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Build and Deploy to Github Pages
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
5+
push:
6+
branches:
77
- "*"
88

99
permissions:
@@ -16,39 +16,41 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
19+
- name: Checkout
20+
uses: actions/checkout@v4
2121

22-
- name: Setup node.js
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: '22.x'
22+
- name: Setup node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '22.x'
2626

27-
- name: Install dependencies
28-
run: npm install --omit=dev
27+
- name: Install dependencies
28+
run: npm install --omit=dev
2929

30-
- name: Build with webpack
31-
run: npm run prod
30+
- name: Build with webpack
31+
run: npm run prod
3232

33-
- name: Setup GitHub Pages
34-
id: pages
35-
uses: actions/configure-pages@v5
33+
- name: Setup GitHub Pages
34+
id: pages
35+
uses: actions/configure-pages@v5
3636

37-
- name: Build site with Jekyll
38-
uses: actions/jekyll-build-pages@v1
39-
with:
40-
source: ./
41-
destination: ${{ github.ref_name == 'master' && './_site' || format('./_site/deployments/{0}', github.ref_name) }}
37+
- name: Build site with Jekyll
38+
uses: actions/jekyll-build-pages@v1
39+
with:
40+
source: ./
41+
destination: ./_site
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
4245

43-
- name: Upload artifact
44-
uses: actions/upload-pages-artifact@v3
45-
4646
deploy:
47-
environment:
48-
name: ${{ github.ref_name == 'master' && 'github-pages' || github.ref_name }}
49-
url: ${{steps.deployment.outputs.page_url}}
5047
runs-on: ubuntu-latest
5148
needs: build
49+
50+
environment:
51+
name: ${{ github.ref_name == 'master' && 'github-pages' || format('branch-{0}', github.ref_name) }}
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
5254
steps:
5355
- name: Deploy to GitHub Pages
5456
id: deployment

0 commit comments

Comments
 (0)