22 lines
623 B
YAML
22 lines
623 B
YAML
name: Deploy to yiGit Sites
|
|
description: Deploys a static site to yiGit Sites hosting
|
|
author: Yigid BALABAN
|
|
inputs:
|
|
root:
|
|
description: Directory containing built site
|
|
default: "."
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- shell: sh
|
|
run: |
|
|
set -e
|
|
USERNAME=$(echo "${GITHUB_REPOSITORY}" | cut -d'/' -f1)
|
|
REPO=$(echo "${GITHUB_REPOSITORY}" | cut -d'/' -f2)
|
|
echo "For user $USERNAME, repository $REPO"
|
|
TARGET="/srv/sites/${USERNAME}/${REPO}"
|
|
mkdir -p "$TARGET"
|
|
echo "$(hostname)"
|
|
rm -rf "$TARGET"/*
|
|
cp -r "${{ inputs.root }}/." "$TARGET/"
|