-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 889 Bytes
/
publish.yml
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
34
35
36
on:
push:
branches:
- main
workflow_dispatch:
env:
# Use the same ssh-agent socket value across all jobs
# Useful when a GH action is using SSH behind-the-scenes
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
run_pull:
name: publish to website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: unnecessary
name: id_rsa
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- name: git add droplet
run: |
cd $GITHUB_WORKSPACE
git remote add droplet ${{ secrets.SSH_DROPLET_REMOTE }}
- name: git push
run: |
cd $GITHUB_WORKSPACE
git push droplet main