This commit is contained in:
@ -1,52 +1,13 @@
|
|||||||
name: build-and-deploy
|
name: test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- deploy
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: 'lightsail-runner'
|
runs-on: 'lightsail-runner'
|
||||||
container:
|
|
||||||
image: klakegg/hugo:ext
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- run: echo "Hello from $(uname -a)"
|
||||||
uses: actions/checkout@v3
|
- run: docker info
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Environment Info
|
|
||||||
run: |
|
|
||||||
hugo version
|
|
||||||
pwd
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
- name: Build site
|
|
||||||
run: |
|
|
||||||
hugo --minify --debug
|
|
||||||
echo "Build completed, checking output:"
|
|
||||||
ls -la public/
|
|
||||||
env:
|
|
||||||
HUGO_ENV: production
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '18'
|
|
||||||
|
|
||||||
- name: Install and Deploy with Surfer
|
|
||||||
run: |
|
|
||||||
echo "Node version: $(node --version)"
|
|
||||||
echo "NPM version: $(npm --version)"
|
|
||||||
npm install -g cloudron-surfer
|
|
||||||
echo "Deploying to server: ${{ secrets.SURFER_SERVER }}"
|
|
||||||
echo "Files to deploy:"
|
|
||||||
ls -la public/
|
|
||||||
if ! surfer put --token ${{ secrets.SURFER_TOKEN }} --server ${{ secrets.SURFER_SERVER }} public/* /; then
|
|
||||||
echo "Deployment failed with status $?"
|
|
||||||
echo "Current directory contents:"
|
|
||||||
ls -la
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Deployment completed successfully"
|
|
Reference in New Issue
Block a user