Skip to content

specify contentType header #5

specify contentType header

specify contentType header #5

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
- name: Build Go web server
run: go build -o server ./main.go
- name: Run web server
run: ./server &
env:
PORT: 8088
- name: Wait for server to start
run: |
sleep 1
curl -s http://localhost:8088 > index.html
- name: Create deployment directory
run: mkdir deployment
- name: Move HTML files to deployment directory
run: mv templates/index.html deployment/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deployment
publish_branch: gh-pages