Skip to content

Commit

Permalink
Update f24_nodebb-teamtbd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ay0503 authored Oct 22, 2024
1 parent 6a33bda commit 75a3086
Showing 1 changed file with 25 additions and 33 deletions.
58 changes: 25 additions & 33 deletions .github/workflows/f24_nodebb-teamtbd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}

0 comments on commit 75a3086

Please sign in to comment.