Skip to content

Commit b30d413

Browse files
Merge pull request #1 from oidc-sweden/feature/publish-script
Build script for publishing HTML to gh-pages
2 parents c0d3ef0 + 7f55797 commit b30d413

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/build.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: gh-pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
paths-ignore:
7+
- README.md
8+
- CONTRIBUTING.md
9+
- LICENSE.md
10+
- .gitignore
11+
branches: ["*"]
12+
release:
13+
types:
14+
- created
15+
- edited
16+
17+
# Allows you to run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
21+
permissions:
22+
contents: write
23+
pages: write
24+
id-token: write
25+
26+
# Allow one concurrent deployment
27+
concurrency:
28+
group: "pages"
29+
cancel-in-progress: true
30+
31+
jobs:
32+
build-and-deploy:
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
runs-on: ubuntu-latest
37+
env:
38+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
39+
steps:
40+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
41+
- uses: actions/checkout@v2
42+
43+
- name: Show env
44+
run: echo "$GITHUB_CONTEXT"
45+
46+
- name: Create html folder
47+
run: mkdir html
48+
49+
- name: Show folders
50+
run: ls -al
51+
52+
- name: Show branch name
53+
run: echo "$BRANCH_NAME"
54+
55+
- name: Run the build process with Docker
56+
run: |
57+
docker run -v `pwd`:/data danielfett/markdown2rfc openid-federation-hosting-1_0.md
58+
- name: rename
59+
run: |
60+
mv ./openid-federation-hosting*.html ./html/$BRANCH_NAME.html
61+
62+
- name: Deploy to GitHub Pages
63+
if: success()
64+
uses: crazy-max/ghaction-github-pages@v2
65+
with:
66+
domain: www.oidc.se
67+
target_branch: gh-pages
68+
build_dir: html
69+
keep_history: true
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
73+
74+

0 commit comments

Comments
 (0)