Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to deploy using Github Actions fails when deploying AWS CDK project #836

Closed
shalotelli opened this issue Jun 16, 2024 · 1 comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@shalotelli
Copy link

Describe the bug

When attempting to deploy using Github Actions everything works fine until the the CDK step where it fails as it does not find the deployment project.

Expected Behavior

Project should deploy as it does locally

Current Behavior

Generating AWS Cloud Development Kit (AWS CDK) deployment project
Unhandled exception.  This is a bug.  Please copy the stack trace below and file a bug at https://github.com/aws/aws-dotnet-deploy. 
Basepath argument is not fully qualified. (Parameter 'basePath')
   at System.IO.Path.GetFullPath(String path, String basePath)
   at AWS.Deploy.Common.IO.DirectoryManager.GetAbsolutePath(String referenceFullPath, String targetRelativePath) in C:\build\src\AWS.Deploy.Common\IO\DirectoryManager.cs:line 94
   at AWS.Deploy.Orchestration.OptionSettingHandler.GetOptionSettingsMap(Recommendation recommendation, ProjectDefinition projectDefinition, IDirectoryManager directoryManager, OptionSettingsType optionSettingsType) in C:\build\src\AWS.Deploy.Orchestration\OptionSettingHandler.cs:line 484
   at AWS.Deploy.Orchestration.CdkAppSettingsSerializer.Build(CloudApplication cloudApplication, Recommendation recommendation, OrchestratorSession session) in C:\build\src\AWS.Deploy.Orchestration\CdkAppSettingsSerializer.cs:line 60
   at AWS.Deploy.Orchestration.CdkProjectHandler.ConfigureCdkProject(OrchestratorSession session, CloudApplication cloudApplication, Recommendation recommendation) in C:\build\src\AWS.Deploy.Orchestration\CdkProjectHandler.cs:line 83
   at AWS.Deploy.Orchestration.DeploymentCommands.CdkDeploymentCommand.ExecuteAsync(Orchestrator orchestrator, CloudApplication cloudApplication, Recommendation recommendation) in C:\build\src\AWS.Deploy.Orchestration\DeploymentCommands\CdkDeploymentCommand.cs:line 38
   at AWS.Deploy.Orchestration.Orchestrator.DeployRecommendation(CloudApplication cloudApplication, Recommendation recommendation) in C:\build\src\AWS.Deploy.Orchestration\Orchestrator.cs:line [252](https://github.com/shalotelli/resumai/actions/runs/9533144725/job/26276060027#step:8:253)
   at AWS.Deploy.CLI.Commands.DeployCommand.ExecuteAsync(String applicationName, String deploymentProjectPath, SaveSettingsConfiguration saveSettingsConfig, DeploymentSettings deploymentSettings) in C:\build\src\AWS.Deploy.CLI\Commands\DeployCommand.cs:line 139
   at AWS.Deploy.CLI.Commands.CommandFactory.<BuildDeployCommand>b__45_0(DeployCommandHandlerInput input) in C:\build\src\AWS.Deploy.CLI\Commands\CommandFactory.cs:line 261
Error: Process completed with exit code 255.

Reproduction Steps

create github actions with the following config

name: Deploy to Production

on:
  push:
    branches: [ "production" ]

jobs:
  setup-dependencies:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20.x

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 8.0.x

  build:
    runs-on: ubuntu-latest
    needs: setup-dependencies
    steps:
      - uses: actions/checkout@v4

      - name: Restore Project Dependencies
        run: dotnet restore

      - name: Build
        run: dotnet build --no-restore

  deploy:
    runs-on: ubuntu-latest
    needs: build
    steps:
      - uses: actions/checkout@v4

      - name: Install AWS Deploy Toolkit
        run: dotnet tool install -g aws.deploy.tools
        
      - name: Install AWS CDK
        run: npm install -g aws-cdk

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-1

      - name: Deploy API
        run: dotnet-aws deploy --silent --project-path path-to.csproj --apply Properties/deploy.json

Possible Solution

No response

Additional Information/Context

No response

Version used

1.20.8+645648dd1e

Operating System and version

Mac OS Sonoma 14.5

@shalotelli shalotelli added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 16, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant