Repository navigation
100 lines (84 loc) · 2.95 KB
/
Copy pathdeploy-dev.yml
File metadata and controls
100 lines (84 loc) · 2.95 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Deploy dev.flora.pm
on:
push:
branches: ["development"]
jobs:
backend:
uses: ./.github/workflows/backend.yml
frontend:
uses: ./.github/workflows/frontend.yml
linting:
uses: ./.github/workflows/linting.yml
flora-server:
needs: [backend, frontend, linting]
runs-on: ubuntu-latest
environment: development
concurrency:
group: dev-deployment-flora-server
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
cache: "npm"
cache-dependency-path: assets/package-lock.json
- name: Build frontend assets
working-directory: assets/
run: |
npm clean-install
npm run build
- name: Archive frontend assets
run: tar -czf static.tar.gz -C static .
- name: Setup SSH
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Invoke Ansible
working-directory: deployment/
run: |
ansible-playbook -vvv \
-i inventory.yaml \
--extra-vars ansible_user=${{ secrets.ANSIBLE_USER }} \
-e "ansible_port=${{ secrets.ANSIBLE_SSH_PORT }}" \
-e "assets_archive=${{ github.workspace }}/static.tar.gz" \
-e "deploy_sha=${{ github.sha }}" \
playbooks/deploy-dev-server.yaml \
--diff
jobs-runner:
needs: [backend, frontend, linting]
runs-on: ubuntu-latest
environment: development
concurrency:
group: dev-deployment-jobs-runner
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
cache: "npm"
cache-dependency-path: assets/package-lock.json
- name: Build frontend assets
working-directory: assets/
run: |
npm clean-install
npm run build
- name: Archive frontend assets
run: tar -czf static.tar.gz -C static .
- name: Setup SSH
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ secrets.ANSIBLE_JOBS_SSH_PRIVATE_KEY }}
- name: Invoke Ansible
working-directory: deployment/
run: |
ansible-playbook -vvv \
-i inventory.yaml \
--extra-vars ansible_user=${{ secrets.ANSIBLE_JOBS_USER }} \
-e "ansible_port=${{ secrets.ANSIBLE_JOBS_SSH_PORT }}" \
-e "assets_archive=${{ github.workspace }}/static.tar.gz" \
playbooks/deploy-dev-job-runner.yaml \
--diff