-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.22 KB
/
docker-image.yml
File metadata and controls
37 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ahrechanychenko
password: ${{ secrets.DOCKERHUB_SECRET }}
- name: Build the Docker image
run: export VERSION=$(jq -r .version package.json) && docker build . --file Dockerfile --tag ahrechanychenko/node-test-app:$VERSION.$GITHUB_RUN_ID
- name: Docker push
run: export VERSION=$(jq -r .version package.json) && docker push ahrechanychenko/node-test-app:$VERSION.$GITHUB_RUN_ID
helm:
runs-on: self-hosted
environment: development
needs: build
steps:
- uses: actions/checkout@v3
- name: check k8s
run: export KUBECONFIG=/Users/ahrechanychenko/.kube/config && kubectl cluster-info
- name: check k8s
run: export VERSION=$(jq -r .version package.json) && export KUBECONFIG=/Users/ahrechanychenko/.kube/config && helm upgrade first-try --set image_tag=$VERSION.$GITHUB_RUN_ID /Users/ahrechanychenko/Documents/DevOps01/k8s/lesson6/nodejs-app-chart -n devops01