Skip to content

Commit

Permalink
feat(github-actions): support isDeployable flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 6, 2024
1 parent 3c5b9b6 commit 122207e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,23 @@ jobs:

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

- name: Deploy to Azure Functions
uses: Azure/functions-action@v1
if: matrix.isDeployable == 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.isDeployable == true
run: sleep 15

- name: Run E2E tests
if: matrix.isDeployable == 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
Expand Down
5 changes: 5 additions & 0 deletions infra/azure-functions/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export const infraConfigs = createInfraConfig(
'node18-win-x64': process.env.RESOURCE_IDENTIFIER_NODE18_WIN_X64,
},
[
{
platform: 'macos',
arch: 'arm64',
runtime: 'node18',
},
{
platform: 'linux',
arch: 'x64',
Expand Down
1 change: 1 addition & 0 deletions infra/azure-functions/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function createInfraConfig(

return {
...infraConfig,
isDeployable: infraConfig.isDeployable ?? false,
resourceIdentifier,
};
});
Expand Down

0 comments on commit 122207e

Please sign in to comment.