Skip to content

Instantly share code, notes, and snippets.

View tcmorris's full-sized avatar
👋

Thomas Morris tcmorris

👋
View GitHub Profile
@tcmorris
tcmorris / github-action-dotnet.yml
Created August 20, 2020 15:58
Example GitHub Action for building and deploying a .NET Core app to Azure.
name: Build and deploy to Azure
on: [push]
env:
PROJECT_DIR: yourapp/path
AZURE_WEBAPP_NAME: yourapp-name
DOTNET_VERSION: '2.2.402'
jobs:
@tcmorris
tcmorris / github-action-nodejs.yml
Created August 20, 2020 16:00
Example GitHub Action for building with node.js
name: Build node.js
on: [push]
env:
NODE_VERSION: '10.x'
jobs:
build-assets:
runs-on: ubuntu-latest
@tcmorris
tcmorris / umbraco8-cleanup.sql
Created January 20, 2022 14:25
Remove previous versions that are no longer published from the umbraco database
SELECT cv.id
INTO #toDelete
FROM umbracoDocumentVersion dv
INNER JOIN umbracoContentVersion cv ON dv.id = cv.id
WHERE cv.[current] != 1 AND dv.published != 1 AND cv.VersionDate < '2021-01-01'
DELETE FROM umbracoPropertyData WHERE versionId IN (select id from #toDelete)
DELETE FROM umbracoDocumentVersion WHERE id IN (select id from #toDelete)
DELETE FROM umbracoContentVersionCultureVariation WHERE versionId IN (select id from #toDelete)
DELETE FROM umbracoContentVersion WHERE id IN (select id from #toDelete)