Replace a bunch of Paragraph and Header usages. #45
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: Sorcery VM DEV deployment | |
on: | |
push: | |
branches: [ dev ] | |
pull_request: | |
branches: [ dev ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish -c Debug -o ./dev | |
- name: Compress artifact | |
run: tar -czvf sorcery-dev.tar.gz -C ./dev . | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: sorcery-dev | |
path: ./sorcery-dev.tar.gz | |
if-no-files-found: error | |
deploy: | |
if: github.ref == 'refs/heads/dev' | |
runs-on: ubuntu-latest | |
needs: [publish] | |
steps: | |
- name: Download artifact | |
uses: actions/[email protected] | |
with: | |
name: sorcery-dev | |
path: ./ | |
- name: Query public IP | |
id: ip | |
uses: haythem/[email protected] | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.SORCERY_AZURE_CREDENTIALS }} | |
- name: Azure CLI - allow connections from worker | |
id: jitAllow | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: 2.34.1 | |
inlineScript: | | |
az network nsg rule create -g ${{ secrets.SORCERY_AZURE_RG_NAME }} --nsg-name ${{ secrets.SORCERY_AZURE_NSG_NAME }} -n GitHubActionDeployJIT --priority 100 \ | |
--source-address-prefixes ${{ steps.ip.outputs.ipv4 }} --destination-port-ranges 22 --direction Inbound --access Allow --protocol TCP | |
- name: Install SSH key | |
uses: shimataro/[email protected] | |
with: | |
key: ${{ secrets.SORCERY_VM_KEY }} | |
known_hosts: ${{ secrets.SORCERY_VM_KNOWN_HOSTS }} | |
- name: scp to Sorcery-VM | |
run: scp ./sorcery-dev.tar.gz "${{ secrets.SORCERY_VM_USER }}@${{ secrets.SORCERY_VM_IP }}:/home/${{ secrets.SORCERY_VM_USER }}/server/dev" | |
- name: Restart nginx via SSH | |
run: ssh "${{ secrets.SORCERY_VM_USER }}@${{ secrets.SORCERY_VM_IP }}" \ | |
"sudo rm -rf /usr/share/nginx/sorcery-dev/* && sudo tar -xzf /home/${{ secrets.SORCERY_VM_USER }}/server/dev/sorcery-dev.tar.gz -C /usr/share/nginx/sorcery-dev . && sudo nginx -s reload" | |
- name: Azure CLI - remove JIT rule | |
if: always() | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: 2.34.1 | |
inlineScript: | | |
az network nsg rule delete -g ${{ secrets.SORCERY_AZURE_RG_NAME }} --nsg-name ${{ secrets.SORCERY_AZURE_NSG_NAME }} -n GitHubActionDeployJIT |