From 1c2e7eb5aa66f3cf67c7b2c7cdcb7b6b372b8f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Fri, 20 Dec 2024 16:19:48 +0100 Subject: [PATCH] Use env variables for cert paths --- .github/workflows/cypress.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index d08e7d7..dca5d24 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -14,6 +14,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set environment variables + run: | + echo PEM_CERT_PATH=$(pwd)/certs/geopilot.pem >> $GITHUB_ENV + echo UBUNTU_TRUSTED_CERT_PATH=/usr/local/share/ca-certificates/geopilot.crt >> $GITHUB_ENV + - name: Setup dotnet uses: actions/setup-dotnet@v4 with: @@ -22,13 +27,13 @@ jobs: - name: Create dev-certs run: | mkdir ./certs - dotnet dev-certs https --export-path ./certs/geopilot.pem --no-password --format PEM + dotnet dev-certs https --export-path ${{ env.PEM_CERT_PATH }} --no-password --format PEM chmod -R 664 ./certs/* - name: Trust dev-certs run: | sudo apt-get install -y ca-certificates - sudo cp ./certs/geopilot.pem /usr/local/share/ca-certificates/geopilot.crt + sudo cp ${{ env.PEM_CERT_PATH }} ${{ env.UBUNTU_TRUSTED_CERT_PATH }} sudo update-ca-certificates - name: Start db and api's @@ -44,4 +49,4 @@ jobs: env: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/geopilot.crt + NODE_EXTRA_CA_CERTS: ${{ env.UBUNTU_TRUSTED_CERT_PATH }}