Skip to content

Commit

Permalink
refactor(github-actions): extract deploy & e2e jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 7, 2024
1 parent 08e6520 commit 5675a28
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,30 +84,47 @@ jobs:
path: examples/with-${{ matrix.runtime }}/.nmt/dist
retention-days: 1

# - name: Azure Login
# uses: azure/login@v2
# if: matrix.is_deployable == true
# with:
# creds: ${{ secrets.AZURE_CREDENTIALS_E2E_TESTS }}

# - name: Deploy to Azure Functions
# uses: Azure/functions-action@v1
# if: matrix.is_deployable == true
# with:
# app-name: nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }}
# package: examples/with-${{ matrix.runtime }}/.nmt/dist


deploy:
runs-on: ubuntu-latest
needs:
- build
- get-matrix
timeout-minutes: 10
strategy:
matrix:
include: ${{fromJson(needs.get-matrix.outputs.deployable_matrix)}}

steps:
- name: Azure Login
uses: azure/login@v2
if: matrix.is_deployable == true
with:
creds: ${{ secrets.AZURE_CREDENTIALS_E2E_TESTS }}

- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.resource_identifier_key }}

- name: Deploy to Azure Functions
uses: Azure/functions-action@v1
if: matrix.is_deployable == true
with:
app-name: nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }}
package: examples/with-${{ matrix.runtime }}/.nmt/dist
package: .

# - name: Wait for the deployment to finish
# if: matrix.is_deployable == true
# run: sleep 15

# - name: Run E2E tests
# if: matrix.is_deployable == true
# run: pnpm exec nx run @infra/azure-functions:test
# env:
# AZURE_FUNCTIONS_URL: https://nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }}.azurewebsites.net
# AZURE_FUNCTIONS_API_KEY: ${{ secrets.AZURE_FUNCTIONS_HOST_KEY }}

e2e:
if: always()
runs-on: ubuntu-latest
Expand Down

0 comments on commit 5675a28

Please sign in to comment.