-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 894 Bytes
/
push_www.yaml
File metadata and controls
33 lines (31 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Auto Deploy to WWW
on:
push:
branches:
- main
paths:
- site/**
workflow_dispatch:
jobs:
build:
name: Deploy to WWW
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy 404 to WWW
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
run: |
mkdir ~/.ssh
echo "$SSH_DEPLOY_KEY" >~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
git clone -b gh-pages --single-branch git@github.com:hackerschoice/hackerschoice.github.io.git
cd hackerschoice.github.io
[ ! -d 404 ] && mkdir 404
cp -a ../site/. 404/
is_updated=1
[ -n "$is_updated" ] && {
git config --local user.name "GitHub Action"
git config --local user.email "root@proton.thc.org"
git add $(find 404 -type f) && git commit -m "404" && git push
}