Skip to content

Create octopusdeploy.yml#2

Merged
Dargon789 merged 2 commits intomasterfrom
Dargon789-patch-1
Jul 3, 2025
Merged

Create octopusdeploy.yml#2
Dargon789 merged 2 commits intomasterfrom
Dargon789-patch-1

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Jul 3, 2025

Summary by Sourcery

Add GitHub Actions workflow to automate Docker image build, registry publish, and deployment via Octopus Deploy on pushes to master.

CI:

  • Introduce ‘Build and Deploy to Octopus Deploy’ workflow with separate build and deploy jobs.
  • Configure build job to set up Docker Buildx, extract metadata, and push the image to a container registry.
  • Configure deploy job to authenticate via OIDC, create an Octopus release, and deploy it to the specified environment.

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Jul 3, 2025

Reviewer's Guide

Introduces a new GitHub Actions workflow (octopusdeploy.yml) that automates Docker image build and push, then performs a release and deployment in Octopus Deploy using OIDC authentication.

Flow diagram for GitHub Actions Octopus Deploy workflow

flowchart TD
  Checkout[Checkout code]
  Buildx[Set up Docker Buildx]
  LoginDocker[Log in to Docker Registry]
  Meta[Extract Docker metadata]
  BuildPush[Build & Push Docker Image]
  LoginOctopus[Log in to Octopus Deploy]
  CreateRelease[Create Octopus Release]
  DeployRelease[Deploy Release to Environment]

  Checkout --> Buildx --> LoginDocker --> Meta --> BuildPush --> LoginOctopus --> CreateRelease --> DeployRelease
Loading

File-Level Changes

Change Details Files
Add GitHub Actions workflow for Octopus Deploy
  • Create .github/workflows/octopusdeploy.yml with push trigger on master
  • Define workflow name and documentation header with setup instructions
  • Declare build and deploy jobs with appropriate permissions
.github/workflows/octopusdeploy.yml
Implement Docker build-and-push process
  • Checkout code and set up Docker Buildx
  • Log in to container registry using docker/login-action
  • Extract image metadata (tags, labels) with docker/metadata-action
  • Build and push Docker image via docker/build-push-action, outputting image_tag
.github/workflows/octopusdeploy.yml
Configure Octopus Deploy release and deployment
  • Request id-token permission for OIDC authentication
  • Log in to Octopus Deploy using OctopusDeploy/login action
  • Create a new release in Octopus with package version from build output
  • Deploy the release to the specified Octopus environment
.github/workflows/octopusdeploy.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Dargon789 - I've reviewed your changes - here's some feedback:

  • The branch filter is using '"master"' with nested quotes; update it to branches: ['master'] (or to your repo’s default branch) to ensure the workflow triggers correctly.
  • The Docker metadata action is tagging images with a static pattern v1.0.0-{{sha}}—consider making the version parameterizable or deriving it dynamically to match real release versions.
  • Using GITHUB_TOKEN for GHCR authentication may not grant the needed package permissions; recommend switching to a PAT stored in secrets with the appropriate package write scope.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The branch filter is using '"master"' with nested quotes; update it to branches: ['master'] (or to your repo’s default branch) to ensure the workflow triggers correctly.
- The Docker metadata action is tagging images with a static pattern v1.0.0-{{sha}}—consider making the version parameterizable or deriving it dynamically to match real release versions.
- Using GITHUB_TOKEN for GHCR authentication may not grant the needed package permissions; recommend switching to a PAT stored in secrets with the appropriate package write scope.

## Individual Comments

### Comment 1
<location> `.github/workflows/octopusdeploy.yml:89` </location>
<code_context>
+      OCTOPUS_SERVICE_ACCOUNT: 'your-service-account-id'  # TODO: update to your service account Id
+      OCTOPUS_SPACE: 'your-space'                         # TODO: update to the name of the space your project is configured in
+      OCTOPUS_PROJECT: 'your-project'                     # TODO: update to the name of your Octopus project
+      OCTOPUS_ENVIRONMENT: 'your-environment'             # TODO: update to the name of the environment to recieve the first deployment
+
+    steps:
</code_context>

<issue_to_address>
Typo in the word 'recieve'.

Please correct 'recieve' to 'receive' in the comment.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
      OCTOPUS_ENVIRONMENT: 'your-environment'             # TODO: update to the name of the environment to recieve the first deployment
=======
      OCTOPUS_ENVIRONMENT: 'your-environment'             # TODO: update to the name of the environment to receive the first deployment
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@Dargon789 Dargon789 merged commit 42f035a into master Jul 3, 2025
13 checks passed
@Dargon789 Dargon789 deleted the Dargon789-patch-1 branch July 3, 2025 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant