-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ jobs: | |
DOMAIN_ALTERNATE: www.backend.masus.no | ||
CERTBOT_EMAIL: [email protected] | ||
DNS_PROVIDER_CREDENTIALS: ${{ secrets.DOMENESHOP_CREDENTIALS }} | ||
PFX_PASSWORD: ${{ secrets.PFX_PASSWORD }} # Ensure password is available | ||
run: | | ||
echo "$DNS_PROVIDER_CREDENTIALS" > /tmp/domeneshop_credentials.ini | ||
chmod 600 /tmp/domeneshop_credentials.ini | ||
|
@@ -46,19 +47,23 @@ jobs: | |
--work-dir /tmp/certbot/work \ | ||
--logs-dir /tmp/certbot/logs | ||
# Use Certbot's generated files for the .pfx file | ||
# Create a .pfx file from the generated certificate | ||
openssl pkcs12 -export -out cert.pfx \ | ||
-inkey /tmp/certbot/config/live/$DOMAIN/privkey.pem \ | ||
-in /tmp/certbot/config/live/$DOMAIN/fullchain.pem \ | ||
-passout pass:$PFX_PASSWORD | ||
# Verify the .pfx file can be opened with the same password | ||
openssl pkcs12 -info -in cert.pfx -passin pass:$PFX_PASSWORD || exit 1 | ||
- name: Upload certificate to Azure Application Gateway | ||
env: | ||
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
AZURE_RESOURCE_GROUP: hilfling-backend_group | ||
AZURE_APPLICATION_GATEWAY_NAME: hilfling-gateway | ||
PFX_PASSWORD: ${{ secrets.PFX_PASSWORD }} | ||
run: | | ||
# Upload certificate to Azure Application Gateway | ||
az network application-gateway ssl-cert create \ | ||
--resource-group $AZURE_RESOURCE_GROUP \ | ||
--gateway-name $AZURE_APPLICATION_GATEWAY_NAME \ | ||
|