diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 00000000..1e597c5d --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,49 @@ +name: ServiceNow GitHub Actions Demo + +on: + pull_request: + push: + branches: + - master + +jobs: + build: + # Purpose of this job is to Apply Remote Changes for the branch triggering + # the pipeline build to the Dev instance, then publish the application to + # app repo using the template versioning format. + name: Publish from Dev + runs-on: ubuntu-latest + # Below line can be used to set conditionals for modifying your pipeline as needed. + # if: ${{ github.event_name == 'pull_request'}} + + steps: + + - name: ServiceNow CI/CD Apply Changes + uses: ServiceNow/sncicd-apply-changes@2.0.0 + env: + nowUsername: ${{ secrets.NOW_USERNAME }} + nowPassword: ${{ secrets.NOW_PASSWORD }} + nowSourceInstance: ${{ secrets.NOW_SOURCE_INSTANCE }} + appSysID: ${{ secrets.APP_SYS_ID }} + - name: ServiceNow CI/CD Publish App + id: publish_app + uses: ServiceNow/sncicd-publish-app@2.0.1 + with: + versionTemplate: 1.1 + versionFormat: template + # Optional, add +X to version number. Default: 1 + # incrementBy: X + env: + nowUsername: ${{ secrets.NOW_USERNAME }} + nowPassword: ${{ secrets.NOW_PASSWORD }} + nowSourceInstance: ${{ secrets.NOW_SOURCE_INSTANCE }} + appSysID: ${{ secrets.APP_SYS_ID }} + + # This is required to pass the version number output from Publish App + # to the input for Install App in the next job! This is because the jobs + # run on different Linux instances, so without this Install App won't know + # what to install. + outputs: + publishversion: ${{ steps.publish_app.outputs.newVersion }} + +#test again