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 2bd8624
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,39 @@ jobs:
path: examples/with-${{ matrix.runtime }}/.nmt/dist
retention-days: 1

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

# - 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 }}

package: .

e2e:
if: always()
runs-on: ubuntu-latest
needs:
- build
- deploy
- get-matrix
timeout-minutes: 10
strategy:
Expand Down

0 comments on commit 2bd8624

Please sign in to comment.