Skip to content

Commit

Permalink
Add ci files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvarko committed Aug 18, 2023
1 parent 4d70695 commit 52f4d3e
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 14 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
push:
branches:
- '**'

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
33 changes: 33 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
push:
tags:
- 'v[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
30 changes: 16 additions & 14 deletions werf.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
configVersion: 1
project: "web-client"
---
image: builder # Название собираемого образа.
from: registry.gitlab.com/tokend/devops/docker-containers:front14-a7d73669fd1fa97a461226c292357bc33d478070 # Базовый образ.
git: # Секция с директивами для добавления исходных файлов из git-репозитория.
- add: / # Исходный путь в репозитории.
to: /app # Путь назначения в образе.
stageDependencies: # Настройка перевыполнения сборочных инструкций при изменениях определённых файлов в репозитории.
install: # Для стадии Install.
image: builder
from: node:16-alpine
git:
- add: /
to: /app
stageDependencies:
install:
- package.json
- yarn.lock
setup: # Для стадии Setup.
setup:
- "**/*"
shell: # Shell сборочные инструкции.
install: # Для стадии Install.
shell:
beforeInstall:
- apk --no-cache --update --virtual build-dependencies add python make g++
install:
- cd /app
#- yarn autoclean --init
#- yarn autoclean --force
- yarn install
setup: # Для стадии Setup.
setup:
- cd /app
- yarn build

---
image: web
from: nginx:stable-alpine
docker:
WORKDIR: /usr/share/nginx
from: nginx:alpine
git:
- add: /nginx.conf
to: /etc/nginx/nginx.conf
Expand All @@ -35,3 +35,5 @@ import:
add: /app/dist
to: /usr/share/nginx/html
after: setup


0 comments on commit 52f4d3e

Please sign in to comment.