This commit is contained in:
parent
da69c1ab5b
commit
a3f54466f2
2 changed files with 31 additions and 2 deletions
29
.forgejo/workflows/update.yaml
Normal file
29
.forgejo/workflows/update.yaml
Normal file
|
@ -0,0 +1,29 @@
|
|||
name: Update Website
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.18
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
|
||||
SSH_PASSWORD: ${{ secrets.SSH_PASSWD }}
|
||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||
steps:
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
- name: Add SSH host to known_hosts
|
||||
run: |
|
||||
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
|
||||
- name: SSH and execute command
|
||||
env:
|
||||
SSH_ASKPASS: /tmp/ssh-pass.sh
|
||||
run: |
|
||||
echo "#!/bin/bash" > /tmp/ssh-pass.sh
|
||||
echo "echo $SSH_PASSWORD" >> /tmp/ssh-pass.sh
|
||||
chmod +x /tmp/ssh-pass.sh
|
||||
DISPLAY=:0 ssh -o StrictHostKeyChecking=no "root@$SSH_HOST" "cd ReactLearn; git pull; docker compose restart"
|
|
@ -106,7 +106,7 @@ function FoodList({ list, setList }: {
|
|||
{list.map((item) =>
|
||||
<div
|
||||
key={item.name}
|
||||
className="flex flex-col sm:flex-row gap-5 bg-slate-200 rounded-md shadow-md border-spacing-1 px-5 py-3 relative"
|
||||
className="flex flex-col sm:flex-row gap-5 bg-slate-200 rounded-md shadow-md border-spacing-1 px-8 sm:px-5 py-3 relative"
|
||||
>
|
||||
<img className="size-24 rounded-full" {...item.image} />
|
||||
<div className="flex-1">
|
||||
|
@ -179,7 +179,7 @@ const FoodOrderer = () => {
|
|||
const [items, setItems] = useState<ShopItem[]>(shopItems)
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<p className="text-center text-2xl sm:text-5xl py-5 sm:py-10 bg-gradient-to-r from-blue-600 to-pink-600 via-green-700 inline-block text-transparent bg-clip-text">
|
||||
<p className="text-center text-5xl py-5 sm:py-10 bg-gradient-to-r from-blue-600 to-pink-600 via-green-700 inline-block text-transparent bg-clip-text">
|
||||
点些什么
|
||||
</p>
|
||||
<FoodList list={items} setList={setItems} />
|
||||
|
|
Loading…
Reference in a new issue