-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) Β· 1.03 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
name: Deploy Site
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
environment:
name: Staging
runs-on: ubuntu-latest
steps:
- name: Install Ansible
shell: bash
run: |
sudo apt update
sudo apt install -y ansible
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Build app
run: npm run build
- name: Load deploy key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Run playbook
run: ansible-playbook -i beta, .playbook/playbook.yml -u github-actions --inventory inventory --extra-vars repositoryPath=$GITHUB_WORKSPACE