Skip to content

Commit

Permalink
Merge pull request #2 from MorpheusAIs/add-ci
Browse files Browse the repository at this point in the history
Add ci
  • Loading branch information
alexvarko authored Jan 5, 2024
2 parents b8188e9 + c81010a commit 418f7b9
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 9 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
push:
branches:
- "add-ci"

permissions:
packages: write

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_SHA
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export web --tag ghcr.io/morpheusais/dashboard:$GITHUB_SHA --dev
# deploy:
# name: Deploy
# needs: converge
# runs-on: ubuntu-latest
# steps:
# - name: ConfigCreate
# run: |
# mkdir ~/.kube/
# echo "${{ secrets.KUBECONFIG }}" > config
# mv config ~/.kube/
# ls ~/.kube/
# kubectl set image deployment/morpheus-webclient webclient=ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA -n morpheus
34 changes: 34 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_REF_NAME
- name: Run Build
run: |
. $(werf ci-env github --as-file)
werf export web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME --dev
17 changes: 8 additions & 9 deletions werf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@ configVersion: 1
project: "web-client"
---
image: builder
from: registry.gitlab.com/tokend/devops/docker-containers:front16-914ecbd7e2465bc9570bf60322f3951eee7989c9
from: node:18-alpine
git:
- add: /
to: /app
stageDependencies:
install:
- package.json
- yarn.lock
setup:
setup:
- "**/*"
shell:
install:
shell:
beforeInstall:
- apk --no-cache --update --virtual build-dependencies add python3 make g++
install:
- cd /app
#- yarn autoclean --init
#- yarn autoclean --force
- yarn install
setup:
setup:
- cd /app
- yarn build
#- sh -c '[ -d /app/dist/files ] && echo "$FILE exist." || mkdir -p /app/dist/files'
#- sh -c '[ -d /app/files ] && echo "$FILE exist." || mkdir -p /app/files'
#- sh -c '[ -z "`ls /app/files`" ] && echo "Empty" || cp -r /app/files/* /app/dist/files'

---
image: web
Expand All @@ -35,4 +34,4 @@ import:
- image: builder
add: /app/dist
to: /usr/share/nginx/html
after: setup
after: setup

0 comments on commit 418f7b9

Please sign in to comment.