fix: github action using node20 (#15) #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TEST | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: mkdir -p build/template | |
- name: ⛑ -> base | |
id: ejs | |
uses: ./ | |
with: | |
template: <h1><%= name %></h1> | |
vars: | | |
{ "name": "${{ github.repository }}" } | |
- run: cat build/index.html | |
- run: echo "${{ steps.ejs.outputs.content }}" | |
- name: ⛑ -> process.env & context | |
uses: ./ | |
with: | |
template: | | |
<h1><%= env.GITHUB_REF %></h1> commiter: <%= context.payload.head_commit.author.name %> | |
output: build/test2.html | |
- run: cat build/test2.html | |
- name: ⛑ -> options | |
uses: ./ | |
with: | |
template: | | |
<h1>{{%= env.GITHUB_REF %}}</h1> commiter: {{%= context.payload.head_commit.author.name %}} | |
output: build/test3.html | |
options: | | |
{ | |
"openDelimiter": "{{", | |
"closeDelimiter": "}}" | |
} | |
- run: cat build/test3.html | |
- name: ⛑ -> template-file | |
uses: ./ | |
with: | |
template-file: template/demo.html | |
output: build/template/demo.html | |
vars: | | |
{ | |
"htmlContent": "${{ steps.ejs.outputs.content }}" | |
} | |
- run: cat build/template/demo.html | |
- name: ⛑ -> ejs file | |
uses: ./ | |
with: | |
template-file: template/demo.ejs | |
output: build/template/demo.html | |
vars: | | |
{ | |
"htmlContent": "${{ steps.ejs.outputs.content }}" | |
} | |
- run: cat build/template/demo.html | |
- name: ⛑ -> vars-file | |
uses: ./ | |
with: | |
template: <div><%= LICENSE %></div><div><%= markdown %></div> | |
output: build/demo.html | |
vars-file: | | |
{ | |
"markdown": "./README.md", | |
"LICENSE": "./LICENSE" | |
} | |
- run: cat build/demo.html |