Skip to content

Commit

Permalink
chore: add auto deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
leon3s committed Jul 11, 2024
1 parent 2822cfa commit 5f9e6de
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy

on:
workflow_run:
workflows: ["Build and publish Docker image"]
types:
- completed

jobs:
post_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install nanocl cli
run: |
wget https://download.next-hat.com/repo/linux/ubuntu/pool/stable/main/nanocl_0.15.0_amd64.deb
sudo dpkg -i nanocl_0.15.0_amd64.deb
rm nanocl_0.15.0_amd64.deb
- name: Deploy to production
run: |
version=$(jq -r '.version' package.json)
nanocl state apply -- --version $version
env:
HOST: ${{ secrets.NANOCL_HOST }}
CERT: ${{ secrets.NANOCL_CERT }}
CERT_KEY: ${{ secrets.NANOCL_CERT_KEY }}
26 changes: 26 additions & 0 deletions Statefile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ApiVersion: v0.15

Args:
- Name: version
Kind: String

Namespace: ntex

Cargoes:
- Name: website
Container:
Image: ntex-rs/website:${{ Args.version }}

Resources:
- Name: ntex.rs
Kind: ncproxy.io/rule
Data:
Rules:
- Domain: ntex.rs
Network: Public
Ssl: cert.ntex.rs
Locations:
- Path: /
Target:
Key: website.ntex.c
Port: 80
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ntex-website",
"version": "2.0.1",
"version": "2.0.2",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down

0 comments on commit 5f9e6de

Please sign in to comment.