Migrate from travisci to github actions
because all my other repos use it and hackernews told me travisci free tier is dead.
This commit is contained in:
parent
cdc54f17b1
commit
1b68e209ac
8 changed files with 76 additions and 46 deletions
29
.github/workflows/ci.yml
vendored
Normal file
29
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: git
|
||||
run: |
|
||||
git clone --depth 1 "https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}" .
|
||||
git config user.name "GitHub Action"
|
||||
git config user.email "action@github.com"
|
||||
git log -1 --format="%H"
|
||||
- name: test
|
||||
run: make test
|
||||
- name: gh-pages
|
||||
run: |
|
||||
git checkout --orphan gh-pages && git reset
|
||||
make generate-gh-pages
|
||||
git add -f docs/ && git commit -m deploy
|
||||
git push -f origin gh-pages
|
||||
- name: notify
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
text="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} failed"
|
||||
curl --silent --output /dev/null ${{secrets.TELEGRAM_URL}} -d "chat_id=${{secrets.TELEGRAM_CHAT_ID}}&text=${text}"
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
|||
/gh-pages/
|
||||
/docs/
|
||||
/go-org
|
||||
/fuzz
|
||||
/org-fuzz.zip
|
14
.travis.yml
14
.travis.yml
|
@ -1,14 +0,0 @@
|
|||
language: go
|
||||
go: "1.x"
|
||||
script:
|
||||
- make test
|
||||
- make generate-gh-pages
|
||||
deploy:
|
||||
provider: pages
|
||||
github-token: $GITHUB_TOKEN # From travis-ci.org repository settings
|
||||
local-dir: gh-pages
|
||||
target-branch: gh-pages
|
||||
skip-cleanup: true
|
||||
verbose: true
|
||||
on:
|
||||
branch: master
|
|
@ -1,4 +1,4 @@
|
|||
* go-org [[https://travis-ci.org/niklasfasching/go-org.svg?branch=master]]
|
||||
* go-org
|
||||
An Org mode parser and static site generator in go.
|
||||
Take a look at github pages
|
||||
- for [[https://niklasfasching.github.io/go-org/][org to html conversion]] examples
|
||||
|
|
|
@ -124,10 +124,10 @@ convert="<html>
|
|||
</body>
|
||||
</html>"
|
||||
|
||||
mkdir -p gh-pages
|
||||
mkdir -p docs
|
||||
go get github.com/chaseadamsio/goorgeous
|
||||
cp etc/_goorgeous.go gh-pages/goorgeous.go
|
||||
go build -o gh-pages/goorgeous gh-pages/goorgeous.go
|
||||
cp etc/_goorgeous.go docs/goorgeous.go
|
||||
go build -o docs/goorgeous docs/goorgeous.go
|
||||
go_org_vs_goorgeous_examples="<html>
|
||||
<head>
|
||||
<style>
|
||||
|
@ -142,20 +142,20 @@ for org_file in $org_files; do
|
|||
go_org_vs_goorgeous_examples+="
|
||||
<h2><a id='${name}' href='#toc-${name}'>${name}</a></h2>
|
||||
<div class='source'>
|
||||
<div class='html'>$(./gh-pages/goorgeous $org_file)</div>
|
||||
<div class='html'>$(./docs/goorgeous $org_file)</div>
|
||||
<div class='html'>$(./go-org render $org_file html-chroma)</div>
|
||||
</div>"
|
||||
done
|
||||
go_org_vs_goorgeous_examples+="</body></html>"
|
||||
rm gh-pages/goorgeous gh-pages/goorgeous.go
|
||||
rm docs/goorgeous docs/goorgeous.go
|
||||
|
||||
echo "$index" > gh-pages/index.html
|
||||
echo "$convert" > gh-pages/convert.html
|
||||
echo "$go_org_vs_goorgeous_examples" > gh-pages/go-org-vs-goorgeous.html
|
||||
cp etc/_wasm.go gh-pages/wasm.go
|
||||
GOOS=js GOARCH=wasm go build -o gh-pages/main.wasm gh-pages/wasm.go
|
||||
rm gh-pages/wasm.go
|
||||
cp $(go env GOROOT)/misc/wasm/wasm_exec.js gh-pages/wasm_exec.js
|
||||
echo "$index" > docs/index.html
|
||||
echo "$convert" > docs/convert.html
|
||||
echo "$go_org_vs_goorgeous_examples" > docs/go-org-vs-goorgeous.html
|
||||
cp etc/_wasm.go docs/wasm.go
|
||||
GOOS=js GOARCH=wasm go build -o docs/main.wasm docs/wasm.go
|
||||
rm docs/wasm.go
|
||||
cp $(go env GOROOT)/misc/wasm/wasm_exec.js docs/wasm_exec.js
|
||||
|
||||
mkdir -p gh-pages/blorg
|
||||
cp -r blorg/testdata/public/* gh-pages/blorg/
|
||||
mkdir -p docs/blorg
|
||||
cp -r blorg/testdata/public/* docs/blorg/
|
||||
|
|
41
org/testdata/misc.html
vendored
41
org/testdata/misc.html
vendored
|
@ -203,20 +203,35 @@ Paragraphs can contain inline markup like <em>emphasis</em> <strong>strong</stro
|
|||
<li>
|
||||
<p>example block</p>
|
||||
<pre class="example">
|
||||
language: go
|
||||
go: "1.x"
|
||||
script:
|
||||
- make test
|
||||
- make generate-gh-pages
|
||||
deploy:
|
||||
provider: pages
|
||||
github-token: $GITHUB_TOKEN # From travis-ci.org repository settings
|
||||
local-dir: gh-pages
|
||||
target-branch: gh-pages
|
||||
skip-cleanup: true
|
||||
verbose: true
|
||||
name: CI
|
||||
|
||||
on:
|
||||
branch: master
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: git
|
||||
run: |
|
||||
git clone --depth 1 "https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}" .
|
||||
git config user.name "GitHub Action"
|
||||
git config user.email "action@github.com"
|
||||
git log -1 --format="%H"
|
||||
- name: test
|
||||
run: make test
|
||||
- name: gh-pages
|
||||
run: |
|
||||
git checkout --orphan gh-pages && git reset
|
||||
make generate-gh-pages
|
||||
git add -f docs/ && git commit -m deploy
|
||||
git push -f origin gh-pages
|
||||
- name: notify
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
text="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} failed"
|
||||
curl --silent --output /dev/null ${{secrets.TELEGRAM_URL}} -d "chat_id=${{secrets.TELEGRAM_CHAT_ID}}&text=${text}"
|
||||
</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
2
org/testdata/misc.org
vendored
2
org/testdata/misc.org
vendored
|
@ -27,7 +27,7 @@ for now files can be included as:
|
|||
- export block
|
||||
#+INCLUDE: "./paragraphs.html" export html
|
||||
- example block
|
||||
#+INCLUDE: "../../.travis.yml" example yaml
|
||||
#+INCLUDE: "../../.github/workflows/ci.yml" example yaml
|
||||
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/33][#33]]: Wrong output when mixing html with Org mode
|
||||
#+HTML: <div class="outline-2" id="meta" style="color: green;">
|
||||
| *foo* | foo |
|
||||
|
|
2
org/testdata/misc.pretty_org
vendored
2
org/testdata/misc.pretty_org
vendored
|
@ -27,7 +27,7 @@ for now files can be included as:
|
|||
- export block
|
||||
#+INCLUDE: "./paragraphs.html" export html
|
||||
- example block
|
||||
#+INCLUDE: "../../.travis.yml" example yaml
|
||||
#+INCLUDE: "../../.github/workflows/ci.yml" example yaml
|
||||
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/33][#33]]: Wrong output when mixing html with Org mode
|
||||
#+HTML: <div class="outline-2" id="meta" style="color: green;">
|
||||
| *foo* | foo |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue