Skip to content

GestaoGrupoMusical-CI-CD #9

GestaoGrupoMusical-CI-CD

GestaoGrupoMusical-CI-CD #9

name: GestaoGrupoMusical-CI-CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: producao
env:
work-directory: Codigo/GestaoGrupoMusicalWeb
solution-directory: Codigo
steps:
- name: Execute checkout in repository
uses: actions/checkout@v2
- name: Configure .NET version
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.413
- name: Replace variables
uses: microsoft/variable-substitution@v1
with:
files: '${{env.work-directory}}/appsettings.json'
env:
ConnectionStrings.GrupoMusicalDatabase: ${{secrets.CONNECTION_STRING}}
- name: Restore dependencies
run: |
cd ${{env.work-directory}}
dotnet restore
- name: Build Application
run: |
cd ${{env.work-directory}}
dotnet build --no-restore
- name: Publish Application
run: |
cd ${{env.work-directory}}
dotnet publish -c --configuration Release --no-restore --output ./publishWEB
- name: Upload via FTP
uses: SamKirkland/[email protected]
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: '${{env.work-directory}}/publishWEB/'
remote-dir: ./
exclude: |
**/.git*
**/.git*/**
**/AnaliseProjeto