-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/threefoldtech/threefold_con…
- Loading branch information
Showing
5 changed files
with
114 additions
and
51 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
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,35 @@ | ||
name: News Staging | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Log into Docker Hub Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.TFDOCKERHUB_USERNAME }} | ||
password: ${{ secrets.TFDOCKERHUB_PASSWORD }} | ||
|
||
- name: Build the Docker image | ||
run: docker build . -t threefolddev/staging-threefold-connect-news:${{ github.sha }} | ||
|
||
- name: Push to dockerhub | ||
run: docker push threefolddev/staging-threefold-connect-news:${{ github.sha }} | ||
|
||
deploy: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Create kubeconfig | ||
run: | | ||
mkdir ${HOME}/.kube | ||
echo ${{ secrets.TF_KUBE_CONFIG }} | base64 --decode > ${HOME}/.kube/config | ||
- name: deploy or upgrade new to kubernetes threefoldconnect-staging | ||
run: helm upgrade news --install helm_files -f helm_files/valuesStaging.yaml --set image.tag=${{ github.sha }} -n threefoldconnect-staging |
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,38 +1,39 @@ | ||
FROM ubuntu:latest as builder | ||
RUN apt-get update | ||
|
||
# Is optional, but if you are not going to use this then you will need to install | ||
# 'gnupg' for nodesource so it can setup node install | ||
RUN apt-get install -y build-essential python-is-python3 make gcc g++ | ||
|
||
RUN apt-get -y install curl | ||
|
||
# The next 2 steps will install node | ||
#RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - | ||
|
||
RUN curl -LO https://nodejs.org/dist/v18.0.0/node-v18.0.0-linux-x64.tar.xz sudo tar -xvf node-v18.0.0-linux-x64.tar.xz sudo cp -r node-v18.0.0-linux-x64/{bin,include,lib,share} /usr/ node --version => v18.0.0 | ||
|
||
# The next 3 steps are for installing yarn | ||
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
|
||
|
||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list | ||
|
||
RUN apt-get update && apt-get install yarn -y | ||
|
||
FROM python:2.7 as builder | ||
|
||
# Update and install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y build-essential make gcc g++ curl gnupg | ||
|
||
# Install Node.js | ||
RUN curl -LO https://nodejs.org/dist/v18.0.0/node-v18.0.0-linux-x64.tar.xz && \ | ||
tar -xvf node-v18.0.0-linux-x64.tar.xz && \ | ||
cp -r node-v18.0.0-linux-x64/bin/* /usr/bin/ && \ | ||
cp -r node-v18.0.0-linux-x64/include/* /usr/include/ && \ | ||
cp -r node-v18.0.0-linux-x64/lib/* /usr/lib/ && \ | ||
cp -r node-v18.0.0-linux-x64/share/* /usr/share/ && \ | ||
node --version | ||
|
||
# Install Yarn | ||
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ | ||
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \ | ||
apt-get update && apt-get install -y yarn | ||
|
||
WORKDIR /app | ||
|
||
# Show Node.js version | ||
RUN node --version | ||
|
||
COPY package.json package.json | ||
COPY yarn.lock yarn.lock | ||
|
||
# Copy and install dependencies | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN yarn build | ||
|
||
# Use Nginx as the server | ||
FROM nginx:alpine as server | ||
COPY --from=builder /app/dist /usr/share/nginx/html | ||
CMD ["nginx", "-g", "daemon off;"] |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
replicaCount: 1 | ||
|
||
environment: staging | ||
|
||
image: | ||
name: news-staging | ||
repo: threefolddev/staging-threefold-connect-news | ||
tag: latest | ||
containerPort: 80 | ||
|
||
service: | ||
port: 80 | ||
targetPort: 80 | ||
|
||
ingress: | ||
hosts: | ||
- name: news.staging.threefold.me | ||
path: / | ||
service: news-staging | ||
port: 80 | ||
|
||
|
||
|
||
|
||
serviceAccount: | ||
# Specifies whether a service account should be created | ||
create: true | ||
# Annotations to add to the service account | ||
annotations: {} | ||
# The name of the service account to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: "" | ||
|
||
|
||
acme: | ||
email: operations@threefold.io |