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

feat: git push #24

Merged
merged 5 commits into from
Feb 21, 2024
Merged

feat: git push #24

merged 5 commits into from
Feb 21, 2024

Conversation

neurosnap
Copy link
Member

@neurosnap neurosnap commented Feb 8, 2024

FEAT

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Deploy to Aptible
      uses: aptible/aptible-deploy-action@v2
      with:
        type: git
        app: <app name>
        environment: <environment name>
        username: ${{ secrets.APTIBLE_USERNAME }}
        password: ${{ secrets.APTIBLE_PASSWORD }}

Approach

We tried to make this as congruent as possible with the current Direct Docker Image Deploy strategy. In that effort, we wanted to support git push without requiring yet another authentication secret -- the SSH private key -- so we had to jump through some hoops to use our Aptible access token for pushing to our git remote.

Security Considerations

We are interfacing directly with primetime in order to perform a git push using just an Aptible token. This makes this paradigm more visible to the outside world, something to think about.

Previous Attempt

#21

The main difference between this PR and that previous one is we now default type to docker which means it should not break anyone's current GHA.

BREAKING CHANGE: `type` is now required (choices: `git` or `docker`)
@neurosnap neurosnap changed the title Feat git push v4 2 feat: git push Feb 8, 2024
@neurosnap neurosnap marked this pull request as ready for review February 15, 2024 14:12
action.yml Outdated
docker_img:
description: 'Docker image'
type:
description: 'Deploy strategy "git" or "deploy"'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: 'Deploy strategy "git" or "deploy"'
description: 'Deploy strategy "git" or "docker"'

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch!

entrypoint.sh Outdated
BRANCH="$GITHUB_REF_NAME"
fi
if [ -z "$BRANCH" ]; then
echo "Aborting: branch is not set; this shouldn't happen, please contact support"
Copy link
Member

Choose a reason for hiding this comment

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

you should probably specify Aptible support since it might seem like we're pointing to GHA support

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated!

@neurosnap neurosnap requested a review from aguilinger February 15, 2024 15:45
@@ -31,4 +38,5 @@ outputs:
description: "The Success/Failure of the action"
runs:
using: 'docker'
image: 'Dockerfile'
# image: 'Dockerfile'
image: docker://quay.io/aptible/aptible-deploy-action:v2
Copy link
Member

Choose a reason for hiding this comment

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

Are you re-using this tag from last time? And did you build and push properly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, same tag. I just built and pushed our recent changes.

@neurosnap neurosnap requested a review from aguilinger February 21, 2024 14:03
@neurosnap neurosnap merged commit c1bb84c into master Feb 21, 2024
@neurosnap neurosnap deleted the feat-git-push-v4-2 branch February 21, 2024 14:33
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.

2 participants