Compare commits
No commits in common. "df2dcb124a737cd6f2c3abd664ab7d4b660fb6a4" and "9e85f28bf627c5a7f58dd8736f306c8c4cd6f1db" have entirely different histories.
df2dcb124a
...
9e85f28bf6
@ -1,99 +0,0 @@
|
|||||||
name: CI/CD Pipeline para YTExtractor
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main, 'release/*' ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main, 'release/*' ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v3
|
|
||||||
with:
|
|
||||||
dotnet-version: '8.0.x'
|
|
||||||
|
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: dotnet build --no-restore
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: dotnet test --no-build --verbosity normal
|
|
||||||
|
|
||||||
- name: Build Docker image
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: false
|
|
||||||
load: true
|
|
||||||
tags: ytextractor:${{ github.sha }}
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
- name: Save Docker image
|
|
||||||
run: docker save ytextractor:${{ github.sha }} > ytextractor-image.tar
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: docker-image
|
|
||||||
path: ytextractor-image.tar
|
|
||||||
|
|
||||||
deploy-localACDC:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: docker-image
|
|
||||||
|
|
||||||
- name: Deploy to localACDC
|
|
||||||
run: |
|
|
||||||
echo "Implantando no servidor localACDC"
|
|
||||||
scp ytextractor-image.tar user@localACDC:/tmp/
|
|
||||||
ssh user@localACDC "docker load < /tmp/ytextractor-image.tar && \
|
|
||||||
docker stop ytextractor || true && \
|
|
||||||
docker rm ytextractor || true && \
|
|
||||||
docker run -d --name ytextractor -p 80:80 ytextractor:${{ github.sha }}"
|
|
||||||
|
|
||||||
deploy-pi2Zero:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
if: startsWith(github.ref, 'refs/heads/release/')
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: docker-image
|
|
||||||
|
|
||||||
- name: Deploy to pi2Zero (Orange Pi Zero)
|
|
||||||
run: |
|
|
||||||
echo "Implantando no Orange Pi Zero (recursos limitados)"
|
|
||||||
# Transfere a imagem para o servidor
|
|
||||||
scp ytextractor-image.tar user@pi2Zero:/tmp/
|
|
||||||
|
|
||||||
# Comandos específicos para o Orange Pi Zero (otimizados para baixa memória)
|
|
||||||
ssh user@pi2Zero "
|
|
||||||
# Limpar recursos não utilizados
|
|
||||||
docker system prune -f
|
|
||||||
|
|
||||||
# Parar e remover contêiner existente
|
|
||||||
docker stop ytextractor || true
|
|
||||||
docker rm ytextractor || true
|
|
||||||
|
|
||||||
# Carregar a nova imagem
|
|
||||||
docker load < /tmp/ytextractor-image.tar
|
|
||||||
|
|
||||||
# Iniciar o serviço com limites de memória
|
|
||||||
docker run -d --name ytextractor -p 80:80 --memory=300m --memory-swap=600m ytextractor:${{ github.sha }}
|
|
||||||
"
|
|
||||||
@ -5,11 +5,6 @@ VisualStudioVersion = 17.11.35327.3
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YTExtractor", "YTExtractor\YTExtractor.csproj", "{7DA7D783-153F-42EF-87E4-239DEC80F91A}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YTExtractor", "YTExtractor\YTExtractor.csproj", "{7DA7D783-153F-42EF-87E4-239DEC80F91A}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipeline", "pipeline", "{5F17A7E6-48F5-4970-B8F6-310BBF9A3C50}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
.gitea\workflow\main.yaml = .gitea\workflow\main.yaml
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
@ -33,8 +33,4 @@
|
|||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include=".gitea\workflow\main.yml" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user