forked from CMU-313/nodebb-f24-team-tbd-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,19 @@ on: | |
- f24 | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
lint-and-test: | ||
uses: | ||
./.github/workflows/test.yaml | ||
|
||
build-and-deploy: | ||
if: github.repository == 'CMU-313/nodebb-f24-team-tbd-1' | ||
needs: lint-and-test | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -19,44 +30,25 @@ jobs: | |
- name: Set up Node.js version | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
node-version: '20.17.0' | ||
|
||
- name: npm install, build, and test | ||
- name: Set up NodeBB | ||
run: | | ||
npm install | ||
npm run build --if-present | ||
npm run test --if-present | ||
- name: Zip artifact for deployment | ||
run: zip release.zip ./* -r | ||
|
||
- name: Upload artifact for deployment job | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: node-app | ||
path: release.zip | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: | ||
name: 'Production' | ||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | ||
|
||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: node-app | ||
./nodebb setup '{"url":"https://nodebb-teamtbd.azurewebsites.net:443", | ||
"admin:username": "admin", | ||
"admin:password": "${{ secrets.ADMIN_PASSWORD }}", | ||
"admin:password:confirm": "${{ secrets.ADMIN_PASSWORD }}", | ||
"admin:email": "[email protected]", | ||
"database": "redis", | ||
"redis:host": "${{ secrets.REDIS_HOST }}", | ||
"redis:port": "6379", | ||
"redis:password": "${{ secrets.REDIS_PASSWORD }}" }' | ||
- name: Unzip artifact for deployment | ||
run: unzip release.zip | ||
|
||
- name: 'Deploy to Azure Web App' | ||
id: deploy-to-webapp | ||
uses: azure/webapps-deploy@v3 | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'nodebb-teamtbd' | ||
slot-name: 'Production' | ||
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_517F2DBC94E34ED1A68ABE9051EEC527 }} | ||
package: . | ||
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_DF2C6F2F58874B1D9E66D7811697249C }} |