Update azure-deploy-f24.yml #17
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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: Build and deploy Node.js app to Azure Web App - nodebb-f24 | |
on: | |
push: | |
branches: | |
- f24 | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
lint-and-test: | |
uses: | |
./.github/workflows/test.yaml | |
build-and-deploy: | |
if: github.repository == 'cmu-313/nodebb-f24-team-sweepers' | |
needs: lint-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true # Initialize submodules | |
fetch-depth: 0 # Fetch the full repository to avoid shallow clone issues | |
- name: Set up Node.js version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.17.0' | |
- name: Set up NodeBB | |
run: | | |
./nodebb setup '{"url":"https://nodebb-sweepers.azurewebsites.net:443", | |
"admin:username": "admin", | |
"admin:password": "${{ secrets.ADMIN_PASSWORD }}", | |
"admin:password:confirm": "${{ secrets.ADMIN_PASSWORD }}", | |
"admin:email": "rohanpadhye@cmu.edu", | |
"database": "redis", | |
"redis:host": "${{ secrets.REDIS_HOST }}", | |
"redis:port": "6379", | |
"redis:password": "${{ secrets.REDIS_PASSWORD }}" }' | |
- name: Install NodeBB dependencies | |
run: npm install | |
- name: Update submodules | |
run: git submodule update --init --recursive --verbose | |
- name: Install frontend submodule | |
run: | | |
cd nodebb-theme-quickstart # Navigate to submodule directory | |
npm install # Install frontend repo dependencies | |
# - name: Install frontend repo | |
# run: | | |
# npm i https://github.com/sschauk/nodebb-theme-quickstart.git | |
- name: Build | |
run: | | |
./nodebb build | |
- name: 'Deploy to Azure Web App' | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'nodebb-sweepers' | |
slot-name: 'Production' | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_86D7EB4F19A7463598FFEA4F3EA36C89 }} | |
package: . |