Skip to content

Commit

Permalink
build_and_push_frontend_and_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
OmelchenkoPeter committed Sep 16, 2023
1 parent ab7352e commit 04a3151
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,74 @@ jobs:
# устанавливаем тег latest, чтобы потом
# на сервере и в docker-compose.yml не указывать версию
tags: back4up/taski_backend:latest




frontend_tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up nodeJS
# Это готовый воркфлоу для установки Node.js на раннер
uses: actions/setup-node@v3
with:
# Это параметр воркфлоу, указывающий нужную версию Node.js
node-version: 18

- name: Install dependencies
# Эта команда устанавливает зависимости для фронтенда
run: |
cd frontend/
npm ci
- name: Test frontend
# Запускаем тесты
run: |
cd frontend/
npm run test
build_frontend_and_push_to_docker_hub:
name: Push frontend Docker image to DockerHub
runs-on: ubuntu-latest
needs: frontend_tests
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to DockerHub
uses: docker/build-push-action@v4
with:
context: ./frontend/
push: true
tags: back4up/taski_frontend:latest




build_gateway_and_push_to_docker_hub:
name: Push gateway Docker image to DockerHub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to DockerHub
uses: docker/build-push-action@v4
with:
context: ./gateway/
push: true
# Тут вместо username должен быть ваш логин на Docker Hub
tags: back4up/taski_gateway:latest

0 comments on commit 04a3151

Please sign in to comment.