Skip to content

Commit

Permalink
wip: add github actions workflow and versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Twinki14 committed Jul 17, 2021
1 parent 3ad67b2 commit 127bab5
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build-publish-dockerfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and publish docker image

# Controls when the workflow will run
on:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
repository_dispatch:
types: [build-publish]

jobs:
build-publish:
runs-on: ubuntu-latest # The type of runner that the job will run on

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: Set version
uses: dotnet/[email protected]
id: nbgv
with:
setAllVars: false

- name: Build and Publish as versioned
uses: VaultVulp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages
image-name: ositemindex.api # Provide only Docker image name, tag will be automatically set to latest
image-tag: ${{ steps.nbgv.outputs.SimpleVersion }}

- name: Build and Publish as latest
uses: VaultVulp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # Provide GITHUB_TOKEN to login into the GitHub Packages
image-name: ositemindex.api # Provide only Docker image name, tag will be automatically set to latest
13 changes: 13 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}

0 comments on commit 127bab5

Please sign in to comment.