-
-
Notifications
You must be signed in to change notification settings - Fork 8
55 lines (51 loc) · 1.52 KB
/
deploy.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Deploy
on:
workflow_dispatch:
inputs:
version:
description: "The version of the website to deploy"
type: string
required: true
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Install node.js v18
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm ci
- name: Check guide build
run: npm run docs:build
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ github.event.inputs.version }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
steps:
- run: |
echo "Updating the website to version ${{ github.event.inputs.version }}!"
- name: Login and redeploy
# Do not use @master because of https://github.com/appleboy/ssh-action/issues/317
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
cd ${{ vars.SSH_PROJECT_ROOT }}
sh deployment/update_and_deploy.sh ${{ github.event.inputs.version }}
sh deployment/move_dummyassets.sh