-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tamal Saha <[email protected]>
- Loading branch information
Showing
8 changed files
with
300 additions
and
36 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,88 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
cluster: | ||
description: 'Cluster' | ||
required: true | ||
type: choice | ||
options: | ||
- ninja | ||
- prod | ||
version: | ||
description: 'Tag' | ||
# required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: f0 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
check-latest: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Linode CLI | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip --version | ||
pip install setuptools | ||
pip install linode-cli --upgrade | ||
- name: Install kubectl | ||
run: | | ||
curl -LO https://dl.k8s.io/release/v1.25.2/bin/linux/amd64/kubectl | ||
chmod +x ./kubectl | ||
sudo mv ./kubectl /usr/local/bin/kubectl | ||
- name: Install yq | ||
run: | | ||
curl -fsSL -o yqq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64 | ||
chmod +x yqq | ||
sudo mv yqq /usr/local/bin/yqq | ||
pip3 install yq | ||
- name: Install Hugo | ||
run: | | ||
curl -fsSL -o hugo_extended.deb https://github.com/gohugoio/hugo/releases/download/v0.111.1/hugo_extended_0.111.1_linux-amd64.deb | ||
sudo dpkg -i hugo_extended.deb | ||
- name: Install Hugo Tools | ||
run: | | ||
curl -fsSL -o hugo-tools https://github.com/appscodelabs/hugo-tools/releases/download/v0.2.23/hugo-tools-linux-amd64 | ||
chmod +x hugo-tools | ||
sudo mv hugo-tools /usr/local/bin/hugo-tools | ||
# - name: Setup upterm session | ||
# uses: lhotari/action-upterm@v1 | ||
|
||
- name: Deploy | ||
env: | ||
REGISTRY: ghcr.io/appscode | ||
LINODE_CLI_TOKEN: ${{ secrets.LINODE_CLI_TOKEN }} | ||
CLUSTER: ${{ inputs.cluster }} | ||
run: | | ||
lke_id=19953 # ninja cluster | ||
if [ "$CLUSTER" = "prod" ]; then | ||
lke_id=25516 # prod cluster | ||
fi | ||
echo "connect to LKE cluster $lke_id" | ||
mkdir -p ~/.kube | ||
linode-cli lke kubeconfig-view $lke_id --json | jq -r .[0].kubeconfig | base64 -d > ~/.kube/config | ||
kubectl get nodes | ||
echo "deploy docker image" | ||
make deploy-to-linode TAG=${{ inputs.version }} |
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
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 |
---|---|---|
|
@@ -3,10 +3,7 @@ name: Release | |
on: | ||
push: | ||
tags: | ||
- "*.*" | ||
schedule: | ||
- cron: '0 0 * * *' | ||
# Allows you to run this workflow manually from the Actions tab | ||
- '*.*' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
|
@@ -16,22 +13,63 @@ concurrency: | |
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-20.04 | ||
runs-on: f0 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.20 | ||
id: go | ||
- name: Check tag matches package version | ||
run: | | ||
PKG_VERSION=$(jq -r '.version' package.json) | ||
GIT_TAG=$(git describe --exact-match --abbrev=0 2>/dev/null || echo "") | ||
test "v${PKG_VERSION}" = "${GIT_TAG}" | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
node-version: '18' | ||
check-latest: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Set up QEMU | ||
id: qemu | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Install kubectl | ||
run: | | ||
curl -LO https://dl.k8s.io/release/v1.25.2/bin/linux/amd64/kubectl | ||
chmod +x ./kubectl | ||
sudo mv ./kubectl /usr/local/bin/kubectl | ||
- name: Install Linode CLI | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip --version | ||
pip install setuptools | ||
pip install linode-cli --upgrade | ||
- name: Prepare git | ||
env: | ||
GITHUB_USER: 1gtm | ||
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} | ||
run: | | ||
set -x | ||
git config --global user.name "${GITHUB_USER}" | ||
git config --global user.email "${GITHUB_USER}@appscode.com" | ||
git config --global \ | ||
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \ | ||
"https://github.com" | ||
- name: Install GitHub CLI | ||
run: | | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
sudo mv bin/hub /usr/local/bin | ||
- name: Install yq | ||
run: | | ||
curl -fsSL -o yqq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64 | ||
|
@@ -50,26 +88,28 @@ jobs: | |
chmod +x hugo-tools | ||
sudo mv hugo-tools /usr/local/bin/hugo-tools | ||
- name: Install Firebase CLI | ||
- name: Build | ||
run: | | ||
npm i -g [email protected] | ||
npm ci | ||
npm run build | ||
- name: QA | ||
- name: Publish to GitHub Container Registry | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
GOOGLE_CUSTOM_SEARCH_API_KEY: ${{ secrets.GOOGLE_CUSTOM_SEARCH_API_KEY }} | ||
if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) | ||
REGISTRY: ghcr.io/appscode | ||
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} | ||
USERNAME: 1gtm | ||
GITHUB_USER: 1gtm | ||
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }} | ||
run: | | ||
npm install | ||
make docs | ||
make qa | ||
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN} | ||
npm run docker-release | ||
- name: Release | ||
- name: Deploy to QA | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
GOOGLE_CUSTOM_SEARCH_API_KEY: ${{ secrets.GOOGLE_CUSTOM_SEARCH_API_KEY }} | ||
if: ${{ github.event_name == 'schedule' }} || (startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) == false) | ||
REGISTRY: ghcr.io/appscode | ||
LINODE_CLI_TOKEN: ${{ secrets.LINODE_CLI_TOKEN }} | ||
run: | | ||
npm install | ||
make docs | ||
make release | ||
mkdir -p ~/.kube | ||
linode-cli lke kubeconfig-view 19953 --json | jq -r .[0].kubeconfig | base64 -d > ~/.kube/config | ||
kubectl get nodes | ||
make deploy-to-linode |
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,75 @@ | ||
name: Release_OLD | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*" | ||
schedule: | ||
- cron: '0 0 * * *' | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.21 | ||
id: go | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '18' | ||
check-latest: true | ||
|
||
- name: Install yq | ||
run: | | ||
curl -fsSL -o yqq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64 | ||
chmod +x yqq | ||
sudo mv yqq /usr/local/bin/yqq | ||
pip3 install yq | ||
- name: Install Hugo | ||
run: | | ||
curl -fsSL -o hugo_extended.deb https://github.com/gohugoio/hugo/releases/download/v0.111.1/hugo_extended_0.111.1_linux-amd64.deb | ||
sudo dpkg -i hugo_extended.deb | ||
- name: Install Hugo Tools | ||
run: | | ||
curl -fsSL -o hugo-tools https://github.com/appscodelabs/hugo-tools/releases/download/v0.2.23/hugo-tools-linux-amd64 | ||
chmod +x hugo-tools | ||
sudo mv hugo-tools /usr/local/bin/hugo-tools | ||
- name: Install Firebase CLI | ||
run: | | ||
npm i -g [email protected] | ||
- name: QA | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
GOOGLE_CUSTOM_SEARCH_API_KEY: ${{ secrets.GOOGLE_CUSTOM_SEARCH_API_KEY }} | ||
if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) | ||
run: | | ||
npm install | ||
make docs | ||
make qa | ||
- name: Release | ||
env: | ||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | ||
GOOGLE_CUSTOM_SEARCH_API_KEY: ${{ secrets.GOOGLE_CUSTOM_SEARCH_API_KEY }} | ||
if: ${{ github.event_name == 'schedule' }} || (startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) == false) | ||
run: | | ||
npm install | ||
make docs | ||
make release |
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,16 @@ | ||
FROM nginx:1.25-alpine | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
RUN set -x \ | ||
&& apk add --update ca-certificates curl | ||
|
||
# Set workdir to the NGINX default dir. | ||
WORKDIR /usr/share/nginx/html | ||
|
||
# Copy HTML from previous build into the Workdir. | ||
COPY public . | ||
|
||
# Expose port 80 | ||
EXPOSE 80/tcp |
Oops, something went wrong.