Skip to content

test123fakk

test123fakk #4

name: Generate and Upload SSL Certificate
on:
push:
branches:
- feature/fg-137
workflow_dispatch:
jobs:
generate-and-upload-cert:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Generate SSL certificate with Certbot
env:
DOMAIN: ${{ backend.masus.no }}

Check failure on line 24 in .github/workflows/get-certificate-in-azure.yml

View workflow run for this annotation

GitHub Actions / Generate and Upload SSL Certificate

Invalid workflow file

The workflow is not valid. .github/workflows/get-certificate-in-azure.yml (Line: 24, Col: 19): Unrecognized named-value: 'backend'. Located at position 1 within expression: backend.masus.no .github/workflows/get-certificate-in-azure.yml (Line: 25, Col: 26): Unexpected symbol: 'fg-web@samfundet'. Located at position 1 within expression: [email protected]
CERTBOT_EMAIL: ${{ [email protected] }}
run: |
sudo apt-get update
sudo apt-get install -y certbot
certbot certonly --standalone -d $DOMAIN --email $CERTBOT_EMAIL --agree-tos -n
openssl pkcs12 -export -out cert.pfx -inkey /etc/letsencrypt/live/$DOMAIN/privkey.pem -in /etc/letsencrypt/live/$DOMAIN/fullchain.pem -passout pass:YourPfxPassword
- 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: |
az network application-gateway ssl-cert create \
--resource-group $AZURE_RESOURCE_GROUP \
--gateway-name $AZURE_APPLICATION_GATEWAY_NAME \
--name app-gateway-cert \
--cert-file cert.pfx \
--cert-password $PFX_PASSWORD