Skip to content

Commit

Permalink
Add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvarko committed Jan 3, 2024
1 parent d8f535d commit d5924f9
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 9 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
branches:
- "add-ci"

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/$GITHUB_REPOSITORY:$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 @@
n:
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 d5924f9

Please sign in to comment.