Skip to content

Commit 93fcea0

Browse files
add support for all js/ts frameworks on akash console (#620)
1 parent 1a54592 commit 93fcea0

File tree

13 files changed

+219
-329
lines changed

13 files changed

+219
-329
lines changed

.github/workflows/main.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Shellcheck, Testing and GitHub Container Registry CI
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
paths:
6+
- 'automatic-deployment-CICD-template/**'
7+
push:
8+
branches:
9+
- master # Changed from main to master
10+
paths:
11+
- 'automatic-deployment-CICD-template/**'
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: consoleCICD
16+
IMAGE_TAG: v1.0.0
17+
18+
jobs:
19+
shellcheck:
20+
name: Shellcheck
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
- name: Run ShellCheck
26+
uses: ludeeus/action-shellcheck@master
27+
with:
28+
severity: error
29+
scandir: './automatic-deployment-CICD-template'
30+
31+
bats:
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
version: ["latest"]
36+
runs-on: ubuntu-latest
37+
env:
38+
BATS_LIB_PATH: "/usr/lib"
39+
TERM: xterm
40+
name: Script testing
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
- name: Setup Bats and Bats-libs
45+
uses: bats-core/bats-action@main
46+
- name: Execute tests
47+
run:
48+
bats -T -p ./automatic-deployment-CICD-template/javascript/main.bats
49+
50+
build:
51+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # Changed from main to master
52+
name: Push Docker image to GitHub Container Registry
53+
runs-on: ubuntu-latest
54+
permissions:
55+
packages: write
56+
contents: read
57+
attestations: write
58+
id-token: write
59+
steps:
60+
- name: Check out the repo
61+
uses: actions/checkout@v4
62+
63+
- name: Log in to the Container registry
64+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
65+
with:
66+
registry: ghcr.io
67+
username: ${{ github.actor }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Build and push Docker images
71+
id: push
72+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
73+
with:
74+
context: ./automatic-deployment-CICD-template
75+
dockerfile: ./automatic-deployment-CICD-template/Dockerfile
76+
push: ${{ github.ref == 'refs/heads/master' }} # Changed from main to master
77+
tags: ghcr.io/${{ github.repository }}/consoleCICD:${{ env.IMAGE_TAG }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bats-core
2+
test1
3+
logs/loki-data
4+
.gitsubmodules
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "test/bats"]
2+
path = test/bats
3+
url = https://github.com/bats-core/bats-core.git
4+
[submodule "test/test_helper/bats-support"]
5+
path = test/test_helper/bats-support
6+
url = https://github.com/bats-core/bats-support.git
7+
[submodule "test/test_helper/bats-assert"]
8+
path = test/test_helper/bats-assert
9+
url = https://github.com/bats-core/bats-assert.git
Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
FROM ubuntu as javascript-automation
22

33
# nvm requirements
4-
RUN apt-get update
5-
RUN echo "y" | apt-get install curl git
4+
RUN apt-get update && apt-get install -y curl git
65
# nvm env vars
76
RUN mkdir -p /usr/local/nvm
87
ENV NVM_DIR /usr/local/nvm
98

10-
# IMPORTANT: set the exact version
119
ENV DEFAULT_NODE_VERSION v20.10.0
1210
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
1311
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $DEFAULT_NODE_VERSION && nvm use --delete-prefix $DEFAULT_NODE_VERSION"
@@ -16,26 +14,11 @@ RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $DEFAULT_NODE_VERSION &&
1614
ENV NODE_PATH $NVM_DIR/versions/node/$DEFAULT_NODE_VERSION/bin
1715
ENV PATH $NODE_PATH:$PATH
1816

17+
# Install global npm packages
1918
RUN npm install -g serve astro http-server yarn pnpm
2019

21-
# RUN apt-get update && \
22-
# apt-get install -y --no-install-recommends \
23-
# python3 \
24-
# python3-pip \
25-
# python3.12-venv
26-
2720
WORKDIR /app
2821
COPY javascript/*.sh common/*.sh index.html /app/
2922
RUN chmod +x *.sh
3023

31-
#CMD /bin/bash -c "/app/js.sh | logdy --ui-ip 0.0.0.0"
3224
CMD ["/app/main.sh"]
33-
34-
FROM python:3.9-alpine3.19 as python-automation
35-
36-
RUN apk add git bash
37-
WORKDIR /app
38-
COPY python/*.sh common/*.sh index.html /app/
39-
RUN chmod +x *.sh
40-
41-
CMD ["bash", "/app/main.sh"]
Lines changed: 62 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,60 @@
1-
# Introducing a Revolutionary Deployment Tool on the Akash Network to Deploy Applications Directly from GitHub/GitLab/BitBucket
2-
3-
If you’ve ever found yourself bogged down by the complexities of deployment and CI/CD, especially on Akash Network, our new tool is here to change the game. Designed to provide a Vercel-like experience, this tool automates the deployment process, allowing you to focus on what you do best—coding!
4-
5-
Note: This tool is currently in the MVP phase.
6-
7-
## Watch the Video
8-
9-
[![Watch the video](https://img.youtube.com/vi/bzPXWKgyEtw/maxresdefault.jpg)](https://youtu.be/bzPXWKgyEtw)
10-
11-
## Empowering Developers with Automation
12-
13-
Deploying applications can often involve a steep learning curve, particularly when dealing with containerization and CI/CD pipelines. Our tool simplifies this by automating deployments directly from your GitHub repository to the Akash Network. It supports several popular JavaScript frameworks, making it a versatile option for many developers.
14-
15-
### Supported Frameworks Include:
16-
17-
#### JavaScript Frameworks:
18-
19-
- **React**
20-
- **Vite-react**
21-
- **Vue.js**
22-
- **Astro**
23-
- **Angular**
24-
- **Express.js**
25-
- **Next.js**
26-
- **Ember.js**
27-
- **Gatsby.js**
28-
- **Vite**
29-
- **VitePress**
30-
- **Nuxt.js**
31-
- **Preact**
32-
- **Ionic React**
33-
- **Ionic Angular**
34-
- **Stencil**
35-
- **Gridsome**
36-
- **Umi.js**
37-
- **11ty.js**
38-
- **Remix**
39-
- **VuePress**
40-
41-
#### Python Frameworks:
42-
43-
- **Django**
44-
- **Flask**
45-
46-
## Key Features That Set Our Tool Apart
47-
48-
This deployment tool isn't just about automating processes; it's about enhancing your workflow and productivity. Here’s what it offers:
49-
50-
- **Automated Builds and Deployments**: Simply link your public GitHub repository, and the tool takes care of the rest. Each commit you push triggers a build and deployment cycle, ensuring your application is always up-to-date.
51-
52-
- **Continuous Integration**: Never worry about out-of-sync versions or manual updates again. This tool ensures that your deployed application mirrors the latest changes in your repository.
53-
54-
- **Customizable Build Processes**: Tailor the deployment process to fit your project's specific needs. Whether it’s specifying a custom build directory or custom commands, you have the flexibility to configure as needed.
55-
56-
- **Roll back to previous good version in case of bad commits**: Incase of commits that break your application and cause error, the tool will automatically roll back to previous good version.
57-
58-
## Getting Started: Simple Steps for Deployment
59-
60-
To leverage this tool effectively, follow these straightforward steps:
61-
62-
1. **Configure Environment Variables**: Adjust the SDL (Service Deployment Language) file to include your project specifics. Key environment variables like `REPO_URL` and `BRANCH_NAME` need to be set to align with your repository details.
63-
64-
2. **Customize the Build Settings**: For projects that don’t fit the conventional build paths or commands, you can easily add custom configurations like `BUILD_DIRECTORY` and `BUILD_COMMAND`.
65-
66-
3. **Deploy Your Application**: With your SDL file configured, deploying your application is as simple as executing the deployment command. The system handles everything from compiling to hosting.
67-
68-
## Sample SDL Configuration for Quick Setup
69-
70-
For a practical application, here’s how you might set up your SDL file:
1+
# Console-CI/CD for JS/TS
2+
3+
**Quick Start**: Access this feature directly at:
4+
https://console.akash.network/new-deployment?step=edit-deployment&templateId=akash-network-awesome-akash-automatic-deployment-CICD-template&gitProvider=github
5+
6+
## Overview
7+
8+
A deployment automation tool for Akash Network that provides a Vercel-like experience. This tool streamlines the deployment process by automating builds and deployments directly from your GitHub repository.
9+
10+
## Supported Frameworks
11+
12+
### JavaScript Frameworks:
13+
- React
14+
- Vite-react
15+
- Vue.js
16+
- Astro
17+
- Angular
18+
- Express.js
19+
- Next.js
20+
- Ember.js
21+
- Gatsby.js
22+
- Vite
23+
- VitePress
24+
- Nuxt.js
25+
- Preact
26+
- Ionic React
27+
- Ionic Angular
28+
- Stencil
29+
- Gridsome
30+
- Umi.js
31+
- 11ty.js
32+
- Remix
33+
- VuePress
34+
35+
## Key Features
36+
37+
- **Automated Builds and Deployments**: Automatic build and deployment cycles triggered by GitHub commits
38+
- **Continuous Integration**: Ensures deployed applications stay synchronized with repository changes
39+
- **Customizable Build Processes**: Configurable build directories and commands
40+
- **Automatic Rollback**: Reverts to previous working version in case of deployment failures
41+
42+
## Getting Started
43+
44+
### 1. Configure Environment Variables
45+
Adjust the SDL file with your project-specific variables:
46+
- `REPO_URL`
47+
- `BRANCH_NAME`
48+
49+
### 2. Customize Build Settings
50+
Configure custom build parameters if needed:
51+
- `BUILD_DIRECTORY`
52+
- `BUILD_COMMAND`
53+
54+
### 3. Deploy
55+
Execute deployment after SDL configuration is complete.
56+
57+
## Sample SDL Configuration
7158

7259
```yaml
7360
---
@@ -106,27 +93,11 @@ deployment:
10693
count: 1
10794
```
10895
109-
This setup details how to expose your service, manage environment variables, and define resource allocations, providing a seamless deployment experience.
110-
Awesome akash repo: [Click Here](https://github.com/akash-network/awesome-akash/blob/master/automatic-deployment-CICD-template/deploy.yml)
111-
112-
113-
## Why This Tool Is a Game Changer
114-
115-
Our deployment tool is more than just a utility—it's a shift towards more efficient, less cumbersome development practices. By streamlining the traditional barriers associated with deployment on Akash Network, it allows you to deploy applications with the ease and agility that modern web development demands.
116-
117-
## What’s Next?
118-
119-
As we look to the future, we are excited to expand the capabilities of this tool. Our roadmap includes:
120-
121-
- **Support for More Languages and Frameworks**: Plans are underway to include support for additional programming languages like Python and Go, broadening the scope of our tool to cater to a more diverse range of projects.
122-
123-
- **Development of a User Interface**: To deliver a truly Vercel-like experience, we are in the process of creating a user-friendly interface. This will make the tool even more accessible and easier to use for all developers.
124-
125-
- **Email Notifications**: We will be introducing email notifications to keep you updated on the status of your deployments and other important events, enhancing the overall user experience.
96+
For the complete SDL template, visit: [Awesome Akash Repository](https://github.com/akash-network/awesome-akash/blob/master/automatic-deployment-CICD-template/deploy.yml)
12697
127-
- **Direct Implementation on Console**: To deliver a truly Vercel-like experience, we will be building user-friendly GUI directly onto console. This will make the tool even more accessible and easier to use for all developers.
12898
129-
As we continue to enhance this tool, we invite you to join us on this journey. Try it out, give us your feedback, and help us redefine the deployment landscape on the Akash Network. Happy coding and deploying!
99+
## Contributing
100+
We welcome feedback and contributions to help improve this deployment tool for the Akash Network community.
130101
131-
Thank you
132-
HoomanHq
102+
## Acknowledgments
103+
Developed by HoomanHq for the Akash Network ecosystem.

0 commit comments

Comments
 (0)