diff --git a/.github/workflows/build-publish-dockerfile.yml b/.github/workflows/build-publish-dockerfile.yml new file mode 100644 index 0000000..581bab4 --- /dev/null +++ b/.github/workflows/build-publish-dockerfile.yml @@ -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/nbgv@v0.4 + id: nbgv + with: + setAllVars: false + + - name: Build and Publish as versioned + uses: VaultVulp/gp-docker-action@1.1.8 + 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/gp-docker-action@1.1.8 + 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 diff --git a/version.json b/version.json new file mode 100644 index 0000000..18cba79 --- /dev/null +++ b/version.json @@ -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 + } + } +} \ No newline at end of file