Update README.md to include submodule initialization step and fix ima… #15
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: Build Error Pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Set up Go environment | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.23" # You can change this to the version you need | |
- name: Copy main.html to templates directory | |
run: | | |
rm -rf ./error-pages/templates/*.html | |
cp main.html ./error-pages/templates/main.html | |
- name: Run go command to build error pages | |
run: | | |
cd error-pages | |
go run ./cmd/error-pages build --add-template=templates/main.html --index | |
- name: Archive | |
run: | | |
mkdir ./out | |
zip -r ./out/error-page.zip ./error-pages/main | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: error-pages-static | |
path: ./out | |
if-no-files-found: error | |
retention-days: 7 | |
- name: Ready to deploy | |
run: | | |
mkdir ./gh-pages | |
mkdir ./gh-pages/main | |
cp -r ./error-pages/main/* ./gh-pages/main/ | |
cp ./error-pages/index.html ./gh-pages/index.html | |
- uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./gh-pages |