Skip to content

Commit 5e45f8c

Browse files
authored
Create main.yml
1 parent de2435e commit 5e45f8c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Deploy algo.n2s
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the main branch
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "deploy"
17+
deploy:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
- name: Create the .ssh directory
27+
run: |
28+
mkdir -p ~/.ssh && chmod 700 ~/.ssh
29+
- name: Install the deploy key
30+
run: |
31+
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/deploy
32+
chmod 600 ~/.ssh/deploy
33+
- name: Create the Known Hosts file
34+
run: |
35+
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
36+
- name: Deploy website
37+
run: |
38+
ssh -i ~/.ssh/deploy [email protected] "${{ secrets.PROJECT_NAME }}"
39+
40+

0 commit comments

Comments
 (0)