Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardocipriano authored Jan 7, 2024
1 parent 7160abb commit 9b81bae
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and Release

on:
push:
branches:
- main # Trigger the workflow on push or pull request to the main branch

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x' # Replace with your .NET version

- name: Build and publish
run: dotnet publish --configuration Release --output ./publish

- name: Copy additional folders
run: |
cp -r Areas ./publish
cp -r Infrastructure ./publish
cp -r Features ./publish
cp -r Views ./publish
cp -r SignalR ./publish
cp -r Properties ./publish
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16' # Replace with your Node.js version

- name: Install npm dependencies
run: npm install

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: publish
path: ./publish

release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: publish

- name: Zip artifacts
run: zip -r publish.zip ./publish

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./publish.zip
asset_name: publish.zip
asset_content_type: application/zip

0 comments on commit 9b81bae

Please sign in to comment.