1+ # The following workflow provides an opinionated template you can customize for your own needs.
2+ #
3+ # To configure Octopus, set the OCTOPUS_API_TOKEN secret to the Octopus API key, and
4+ # set the OCTOPUS_SERVER_URL secret to the Octopus URL.
5+ #
6+ # Double check the "project" and "deploy_to" properties in the "Create Octopus Release" step
7+ # match your Octopus projects and environments.
8+ #
9+ # Get a trial Octopus instance from https://octopus.com/start
10+
111jobs :
212 build :
313 runs-on : ubuntu-latest
414 steps :
515 - uses : actions/checkout@v1
616 with :
717 fetch-depth : ' 0'
18+ - uses : actions/setup-node@v2
19+ with :
20+ node-version : lts/*
821 - name : Install GitVersion
922 uses : gittools/actions/gitversion/setup@v0.9.7
1023 with :
1124 versionSpec : 5.x
1225 - id : determine_version
1326 name : Determine Version
1427 uses : gittools/actions/gitversion/execute@v0.9.7
28+ with :
29+ additionalArguments : /overrideconfig mode=Mainline
1530 - name : Install Octopus Deploy CLI
1631 uses : OctopusDeploy/install-octocli@v1.1.1
1732 with :
1833 version : latest
1934 - name : Install Dependencies
20- run : npm install
35+ run : npm ci
2136 shell : bash
2237 - name : List Dependencies
2338 run : npm list --all > dependencies.txt
5570 octo pack \
5671 --basePath ${SOURCEPATH} \
5772 --outFolder ${OUTPUTPATH} \
58- --id RandomQuotes-JS \
73+ --id nodejs1application \
5974 --version ${{ steps.determine_version.outputs.semVer }} \
6075 --format zip \
6176 --overwrite \
@@ -75,14 +90,19 @@ jobs:
7590 --include '**/*.txt' \
7691 --include '**/*.Procfile'
7792 shell : bash
93+ - name : Tag Release
94+ uses : mathieudutour/github-tag-action@v6.0
95+ with :
96+ custom_tag : ${{ steps.determine_version.outputs.semVer }}
97+ github_token : ${{ secrets.GITHUB_TOKEN }}
7898 - env :
7999 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80100 id : create_release
81101 name : Create Release
82102 uses : actions/create-release@v1
83103 with :
84- tag_name : ${{ steps.determine_version.outputs.semVer }}. ${{ github.run_number }}
85- release_name : Release ${{ steps.determine_version.outputs.semVer }}. ${{ github.run_number }}
104+ tag_name : ${{ steps.determine_version.outputs.semVer }}+run ${{ github.run_number }}-attempt${{ github.run_attempt }}
105+ release_name : Release ${{ steps.determine_version.outputs.semVer }} Run ${{ github.run_number }} Attempt ${{ github.run_attempt }}
86106 draft : ' false'
87107 prerelease : ' false'
88108 - env :
@@ -91,31 +111,34 @@ jobs:
91111 uses : actions/upload-release-asset@v1
92112 with :
93113 upload_url : ${{ steps.create_release.outputs.upload_url }}
94- asset_path : RandomQuotes-JS .${{ steps.determine_version.outputs.semVer }}.zip
95- asset_name : RandomQuotes-JS .${{ steps.determine_version.outputs.semVer }}.zip
114+ asset_path : nodejs1application .${{ steps.determine_version.outputs.semVer }}.zip
115+ asset_name : nodejs1application .${{ steps.determine_version.outputs.semVer }}.zip
96116 asset_content_type : application/octet-stream
97117 - name : Push to Octopus
98118 uses : OctopusDeploy/push-package-action@v1.1.1
99119 with :
100120 api_key : ${{ secrets.OCTOPUS_API_TOKEN }}
101- packages : RandomQuotes-JS .${{ steps.determine_version.outputs.semVer }}.zip
121+ packages : nodejs1application .${{ steps.determine_version.outputs.semVer }}.zip
102122 server : ${{ secrets.OCTOPUS_SERVER_URL }}
123+ overwrite_mode : OverwriteExisting
103124 - name : Generate Octopus Deploy build information
104125 uses : xo-energy/action-octopus-build-information@v1.1.2
105126 with :
106127 octopus_api_key : ${{ secrets.OCTOPUS_API_TOKEN }}
107- octopus_project : RandomQuotes-JS
128+ octopus_project : nodejs1application
108129 octopus_server : ${{ secrets.OCTOPUS_SERVER_URL }}
109130 push_version : ${{ steps.determine_version.outputs.semVer }}
110- push_package_ids : RandomQuotes-JS
131+ push_package_ids : nodejs1application
132+ push_overwrite_mode : OverwriteExisting
111133 output_path : octopus
112134 - name : Create Octopus Release
113135 uses : OctopusDeploy/create-release-action@v1.1.1
114136 with :
115137 api_key : ${{ secrets.OCTOPUS_API_TOKEN }}
116- project : RandomQuotes-JS
138+ project : nodejs1application
117139 server : ${{ secrets.OCTOPUS_SERVER_URL }}
118140 deploy_to : Development
141+ packages : nodejs1application:${{ steps.determine_version.outputs.semVer }}
119142name : Node.js Build
120143' on ' :
121144 workflow_dispatch : {}
0 commit comments