-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement build preview with latest styles (wip)
- Loading branch information
1 parent
446e05e
commit 0d2d368
Showing
2 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,16 +80,13 @@ jobs: | |
- name: Generate index file | ||
run: | | ||
echo "<html> | ||
<head> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> | ||
</head> | ||
<body><h1>Deployed Branches</h1><ul>" > deployment/index.html | ||
for archive in deployment/archives/*.tar; do | ||
branch_name=$(basename $archive .tar) | ||
echo "<li><a href='./${branch_name}/'>${branch_name}</a></li>" >> deployment/index.html | ||
done | ||
echo "</ul></body></html>" >> deployment/index.html | ||
branches=$(ls deployment/archives/*.tar | xargs -n 1 basename | sed 's/.tar//') | ||
echo "branches=$branches" >> $GITHUB_ENV | ||
node scripts/build-preview.js $branches > deployment/index.html | ||
cp deployment/index.html src/pages/preview.twig | ||
pnpm build | ||
rm deployment/index.html | ||
mv dist/preview.html deployment/index.html | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const processBranches = (branches) => | ||
branches | ||
.map((branch) => `<li><a href='./${branch}/'>${branch}</a></li>`) | ||
.join('') | ||
|
||
const main = () => { | ||
const branches = process.argv.slice(2) | ||
console.log( | ||
` | ||
<html> | ||
<head> | ||
<title>Stadt Koeln - Open Data</title> | ||
<link rel='stylesheet' href='/src/styles/styles.scss'> | ||
</head> | ||
<body> | ||
<h1>Deployed Branches</h1> | ||
<ul> | ||
${processBranches(branches)} | ||
</ul> | ||
</body> | ||
</html> | ||
`.trim() | ||
) | ||
} | ||
|
||
main() |