-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
236 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
GIT_BRANCH_COLOR_CLEAN=$(tput setaf 2) | ||
GIT_BRANCH_COLOR_DIRTY=$(tput setaf 1) | ||
BOLD=$(tput bold) | ||
NORM=$(tput sgr0) | ||
NO_COLOR=$(tput sgr0) | ||
|
||
parse_git_branch() | ||
{ | ||
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/') | ||
|
||
if [[ -n $branch ]] | ||
then | ||
if [ -n "$(git status --untracked-files=no --porcelain)" ] | ||
then | ||
# Uncommitted changes | ||
branch+='*' | ||
echo "${GIT_BRANCH_COLOR_DIRTY}${BOLD}${branch}${NORM}${NO_COLOR}" | ||
else | ||
echo "${GIT_BRANCH_COLOR_CLEAN}${branch}${NO_COLOR}" | ||
fi | ||
fi | ||
} | ||
|
||
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]\[\033[01;34m\] \w\[\$(parse_git_branch)\]\[\e[00m\]\n> " |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM ubuntu:24.04 | ||
|
||
ARG project_dir=/home/ubuntu/project | ||
ARG ruby_version=3.1.4 | ||
ARG node_version=16.13.2 | ||
|
||
ENV RUBY_VERSION=${ruby_version} | ||
ENV NODE_VERSION=${node_version} | ||
|
||
RUN \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | ||
curl \ | ||
git \ | ||
ca-certificates \ | ||
build-essential \ | ||
openssh-client \ | ||
sudo \ | ||
zlib1g-dev | ||
|
||
# Disable password prompt for sudo commands | ||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
|
||
USER ubuntu | ||
WORKDIR ${project_dir} | ||
|
||
RUN \ | ||
curl -sSL https://get.rvm.io | bash -s stable && \ | ||
/home/ubuntu/.rvm/bin/rvm install ${ruby_version} && \ | ||
/home/ubuntu/.rvm/bin/rvm use ${ruby_version} | ||
|
||
RUN \ | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash | ||
|
||
COPY \ | ||
.devcontainer/.git_branch_bash \ | ||
/home/ubuntu | ||
|
||
RUN \ | ||
tee -a /home/ubuntu/.bashrc <<EOF | ||
alias mkc='make clean' | ||
source /home/ubuntu/.git_branch_bash | ||
source /usr/share/bash-completion/completions/git | ||
EOF | ||
|
||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM ghcr.io/shanteacontrols/website:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
{ | ||
"name": "Shantea Controls Website", | ||
"dockerComposeFile": [ | ||
"../docker-compose-build.yml" | ||
], | ||
"service": "shanteacontrols-website", | ||
"workspaceFolder": "/home/ubuntu/website", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"eamodio.gitlens", | ||
"xaver.clang-format", | ||
"timonwong.shellcheck" | ||
] | ||
} | ||
} | ||
"name": "${localWorkspaceFolderBasename}", | ||
"build": { | ||
"dockerfile": "Dockerfile.ghcr", | ||
"context": "${localWorkspaceFolder}" | ||
}, | ||
"workspaceMount": "src=${localWorkspaceFolder},dst=/home/ubuntu/project,type=bind", | ||
"workspaceFolder": "/home/ubuntu/project", | ||
"mounts": [ | ||
{ | ||
"source": "${localEnv:HOME}/.gitconfig", | ||
"target": "/etc/gitconfig", | ||
"type": "bind" | ||
}, | ||
{ | ||
"source": "${localEnv:HOME}/.ssh", | ||
"target": "/home/ubuntu/.ssh", | ||
"type": "bind" | ||
} | ||
], | ||
"runArgs": [ | ||
"--network=host", | ||
"--hostname=${localWorkspaceFolderBasename}" | ||
], | ||
"containerUser": "ubuntu", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"eamodio.gitlens", | ||
"xaver.clang-format", | ||
"timonwong.shellcheck" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,24 +8,40 @@ on: | |
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: paradajz168/website-dev:latest | ||
options: --user root | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark repository as safe | ||
run: git config --global --add safe.directory /__w/website/website | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Pull the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Deploy | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup missing directories and files on the runner | ||
run: | | ||
git config --global user.name "web_bot" | ||
git config --global user.email "[email protected]" | ||
make prod | ||
git checkout gh-pages | ||
cp -R _site/deploy/* . | ||
git add . | ||
git commit --allow-empty -m "update" | ||
git push https://github.com/shanteacontrols/website gh-pages | ||
mkdir -p ~/.ssh | ||
touch ~/.gitconfig | ||
- name: Prepare container | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: website # Local name only | ||
imageTag: latest # Local tag only | ||
push: never | ||
- name: Deploy | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: website | ||
imageTag: latest | ||
push: never | ||
runCmd: | | ||
git config --global user.name "web_bot" | ||
git config --global user.email "[email protected]" | ||
make prod | ||
git checkout gh-pages | ||
cp -R _site/deploy/* . | ||
git add . | ||
git commit --allow-empty -m "update" | ||
git push https://github.com/shanteacontrols/website gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ _site/* | |
css/style.css | ||
.env_setup | ||
gems/* | ||
.nvm/* | ||
.nvm/* | ||
.installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.