feat(settings): Update settings page #47
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
name: Deploy to Server | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- develop | |
permissions: | |
contents: read | |
packages: read | |
deployments: write | |
jobs: | |
# First: Make sure dev build ran fine. | |
build-test-solution: | |
name: Build & Test Solution | |
uses: Nodsoft/workflows/.github/workflows/build-dotnet.yml@main | |
with: | |
dotnet-version: '8.0' | |
configuration: 'Release' | |
project-file: 'WoWS-Karma.sln' | |
# Build & Package API & Web from 'build-package-api.yml' and 'build-package-web.yml'. | |
build-package-api: | |
name: Build & Package API | |
needs: build-test-solution | |
uses: Nodsoft/workflows/.github/workflows/package-dotnet.yml@main | |
strategy: | |
matrix: | |
configuration: ['production', 'preview'] | |
with: | |
dotnet-version: '8.0' | |
configuration: ${{ matrix.configuration }} | |
project-file: 'WowsKarma.Api/WowsKarma.Api.csproj' | |
artifact-name: 'wowskarma_api_${{ matrix.configuration }}' | |
build-package-web: | |
name: Build & Package Web App | |
needs: build-test-solution | |
uses: ./.github/workflows/build-package-web.yml | |
strategy: | |
matrix: | |
configuration: ['production', 'preview'] | |
with: | |
build_configuration: ${{ matrix.configuration }} | |
artifact_name: 'wowskarma_app_${{ matrix.configuration }}' | |
deploy-preview: | |
name: Deploy Preview to server | |
environment: | |
name: preview | |
url: https://preview.wows-karma.com/ | |
needs: | |
- build-package-api | |
- build-package-web | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download packaged API artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: wowskarma_api_preview | |
path: ./api | |
- name: Download packaged Web App artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: wowskarma_app_preview | |
path: ./web | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATEKEY }} | |
known_hosts: '*.nodsoft.net' | |
- name: Add Known Hosts | |
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy with rsync | |
run: rsync -rvmzOE . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_DEPLOYPATH }} | |
- name: Restart API service(s) | |
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} ${{ vars.SSH_CMD_RESTART_API }} | |
deploy-live: | |
name: Deploy Live to server | |
if: ${{ github.ref == 'refs/heads/main' }} | |
environment: | |
name: live | |
url: https://wows-karma.com/ | |
needs: | |
- build-package-api | |
- build-package-web | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download packaged API artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: wowskarma_api_production | |
path: ./api | |
- name: Download packaged Web App artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: wowskarma_app_production | |
path: ./web | |
- name: Install SSH Key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATEKEY }} | |
known_hosts: '*.nodsoft.net' | |
- name: Add Known Hosts | |
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy with rsync | |
run: rsync -rvmzOE . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_DEPLOYPATH }} | |
- name: Restart API service(s) | |
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} ${{ vars.SSH_CMD_RESTART_API }} |