Skip to content

Commit

Permalink
nsg rule for certbot renew
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan815 committed Jun 21, 2023
1 parent edddd9a commit 1f8491e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/certbot_renew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: dig +short myip.opendns.com @resolver1.opendns.com
run: dig +short myip.opendns.com @resolver1.opendns.com

- name: Add NSG Rule
uses: venura9/manage-nsg@master
id: rule
with:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
rule-nsg-resource-group-name: threes-game
rule-nsg-name: threes-server-nsg
rule-inbound-port: '22'

- name: Print Created NSG Rule Name
run: echo "Rule Name ${{ steps.rule.outputs.rule_name }}"

- name: Run playbook on server to renew SSL certificate
uses: dawidd6/action-ansible-playbook@v2
with:
Expand All @@ -22,3 +37,12 @@ jobs:
[all]
${{ vars.APP_SERVER_HOSTNAME }} ansible_connection=ssh ansible_user=app_server_user
requirements: galaxy-requirements.yml

- name: Remove NSG Rule
uses: venura9/manage-nsg@master
if: always()
with:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
rule-id-for-removal: ${{ steps.rule.outputs.rule_name }}
rule-nsg-resource-group-name: threes-game
rule-nsg-name: threes-server-nsg

0 comments on commit 1f8491e

Please sign in to comment.