Skip to content

Instantly share code, notes, and snippets.

@Mackolicious
Created December 12, 2020 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mackolicious/fce6578b0ad570d1dc301a37625f1ccc to your computer and use it in GitHub Desktop.
Save Mackolicious/fce6578b0ad570d1dc301a37625f1ccc to your computer and use it in GitHub Desktop.
Sample GitHub Action for .NET & NodeJs
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Main Web CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
working-directory: Pages
- run: npx webpack --config webpack.prod.js
working-directory: Pages
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Restore packages
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Publish
run: dotnet publish --configuration Release
- name: Archive site artifact
uses: actions/upload-artifact@v2
with:
name: Site
path: |
bin/Release/netcoreapp3.1/publish
!bin/Release/netcoreapp3.1/publish/wwwroot/assets
- name: Archive assets artifacts
uses: actions/upload-artifact@v2
with:
name: Assets
path: |
bin/Release/netcoreapp3.1/publish/wwwroot/assets/js/main.js
bin/Release/netcoreapp3.1/publish/wwwroot/assets/js/react-bulk.min.js
bin/Release/netcoreapp3.1/publish/wwwroot/assets/js/vendor.min.js
bin/Release/netcoreapp3.1/publish/wwwroot/assets/css/bulk.min.css
bin/Release/netcoreapp3.1/publish/wwwroot/assets/css/vendor.min.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment