Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

criando branch #66

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/CImain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI/

on:
# workflow_dispatch:
push:
branches: ["main"]

jobs:
CI:
runs-on: windows

steps:
- uses: actions/[email protected]
- name: Autenticar no dokcer hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Contruindo imagem Docker
uses: docker/[email protected]
with:
context: ./src
file: ./src/Dockerfile
push: true
tags: |
nilozjr/conversor-temp-2023:${{github.run_number}}
nilozjr/conversor-temp-2023:latest
- name: Upload do artefato
uses: actions/[email protected]
with:
name: src
path: ./src/*
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: src
path: C:\Users\Olin\src

CD:
runs-on: windows
needs: CI
environment:
name: homol
url: 'http://localhost:8080'
steps:
- name: deploy
run: |
cd C:\Users\Olin\src
docker compose down
docker compose up -d
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI-CD

on:
workflow_dispatch:
# push:
# branches: ["main"]

jobs:
CI:
runs-on: windows

steps:
- uses: actions/[email protected]
- name: Autenticar no dokcer hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USUARIO}}
password: ${{ secrets.DOCKERHUB_PASS }}
# username: ${{ secrets.DOCKERHUB_USUARIO }}
# password: ${{ secrets.DOCKERHUB_PASS }}
- name: Contruindo imagem Docker
uses: docker/[email protected]
with:
context: ./src
file: ./src/Dockerfile
push: true
tags: |
nilozjr/conversor-temp-2023:${{github.run_number}}
nilozjr/conversor-temp-2023:latest
- name: Upload do artefato
uses: actions/[email protected]
with:
name: src
path: ./src/*
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: src
path: C:\Users\Olin\src

CD:
runs-on: windows
needs: CI
environment:
name: homol
url: 'https://www.cassems.com.br'
steps:
- name: deploy
run: |
cd C:\Users\Olin\src
docker compose down
docker compose up -d
7 changes: 7 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:latest
WORKDIR /app
COPY package*.json ./
RUN npm install
copy . .
EXPOSE 8080
CMD ["node", "server.js"]
7 changes: 7 additions & 0 deletions src/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.7'
services:
kube-news:
image: nilozjr/conversor-temp-2023:latest
container_name: kubenews
ports:
- "8080:8080"
2 changes: 1 addition & 1 deletion src/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<main class="flex-shrink-0">
<div class="container" style="padding: 60px 15px 0;">
<form class="row g-3" action="/" method="post">
<h1>Conversor de Temperatura</h1>
<h1>Conversor de Temperatura - ALTERADO 30/03/2023 | 15:00</h1>
<div class="mb-3 row">
<select class="form-select" aria-label="Default select example" id="selectTemp" name="selectTemp">
<option selected value="1">Celsius => Fahrenheit</option>
Expand Down