pedini.dev/.gitea/workflows/deploy.yaml
Bryan Joshua Pedini ec6bbafb2e
All checks were successful
Deploy website on production server when committing on main / test (push) Successful in 8s
no, as it turns out, variables were not defined
2024-08-21 23:15:08 +02:00

35 lines
1.1 KiB
YAML

---
name: Deploy website on production server when committing on main
concurrency: 1
on:
push:
branches:
- main
defaults:
run:
shell: bash
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: echo "${{ secrets.SSH_PRIVATE_KEY }}" > /private.key
- run: chmod 600 /private.key
- run: |
export HUGO_VERSION=$(curl --silent -I https://github.com/gohugoio/hugo/releases/latest | grep location | sed 's|.*tag/||' | tr -d '\r')
export HUGO_VERSION_SHORT=$(echo ${HUGO_VERSION} | sed 's/v//')
wget https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_${HUGO_VERSION_SHORT}_linux-amd64.deb
dpkg -i hugo_*.deb
- uses: actions/checkout@v4
with:
submodules: true
- run: APP_VERSION=latest make
- run: |
export SSH_PRIVATE_KEY=/private.key
export SSH_USERNAME=${{ secrets.SSH_USERNAME }}
export DEPLOYMENT_HOST=${{ secrets.DEPLOYMENT_HOST }}
export DEPLOYMENT_PATH=${{ secrets.DEPLOYMENT_PATH }}
make deploy