Skip to content

test: ci/cd deploy

test: ci/cd deploy #2

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy n2s-dsp
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
- name: Create the .ssh directory
run: |
mkdir -p ~/.ssh && chmod 700 ~/.ssh
- name: Install the deploy key
run: |
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/deploy
chmod 600 ~/.ssh/deploy
- name: Create the Known Hosts file
run: |
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
- name: Deploy website
run: |
ssh -i ~/.ssh/deploy [email protected] "${{ secrets.PROJECT_NAME }}"