Skip to content

Commit 5f9e6de

Browse files
committed
chore: add auto deploy workflow
1 parent 2822cfa commit 5f9e6de

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

.github/workflows/deploy.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Build and publish Docker image"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
post_deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Install nanocl cli
18+
run: |
19+
wget https://download.next-hat.com/repo/linux/ubuntu/pool/stable/main/nanocl_0.15.0_amd64.deb
20+
sudo dpkg -i nanocl_0.15.0_amd64.deb
21+
rm nanocl_0.15.0_amd64.deb
22+
23+
- name: Deploy to production
24+
run: |
25+
version=$(jq -r '.version' package.json)
26+
nanocl state apply -- --version $version
27+
env:
28+
HOST: ${{ secrets.NANOCL_HOST }}
29+
CERT: ${{ secrets.NANOCL_CERT }}
30+
CERT_KEY: ${{ secrets.NANOCL_CERT_KEY }}

Statefile.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ApiVersion: v0.15
2+
3+
Args:
4+
- Name: version
5+
Kind: String
6+
7+
Namespace: ntex
8+
9+
Cargoes:
10+
- Name: website
11+
Container:
12+
Image: ntex-rs/website:${{ Args.version }}
13+
14+
Resources:
15+
- Name: ntex.rs
16+
Kind: ncproxy.io/rule
17+
Data:
18+
Rules:
19+
- Domain: ntex.rs
20+
Network: Public
21+
Ssl: cert.ntex.rs
22+
Locations:
23+
- Path: /
24+
Target:
25+
Key: website.ntex.c
26+
Port: 80

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ntex-website",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",

0 commit comments

Comments
 (0)