Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
on:
pull_request:
types: [closed]
branches:
- master
jobs:
docker:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
steps:
- uses: actions/checkout@v1
- run: sudo pip install gigalixir --ignore-installed six
- run: gigalixir login -e "${{ secrets.GIGALIXIR_EMAIL }}" -y -p "${{ secrets.GIGALIXIR_PASSWORD }}"
- run: gigalixir git:remote ${{ secrets.GIGALIXIR_APP_NAME }}
- run: git push -f gigalixir HEAD:refs/heads/master
@nazarsh

This comment has been minimized.

Copy link

nazarsh commented Feb 16, 2020

Thanks for the example! Is this a preferred approach compared to the instructions on the Gigalixir site for the App Setup?

Deploy

git remote add gigalixir https://${email}...
@jesseshieh

This comment has been minimized.

Copy link
Owner Author

jesseshieh commented Feb 16, 2020

Oh, do you mean the getting started guide? The guide is supposed to be a walkthrough to get your app ready and deployed. This file is a GitHub actions configuration a customer used to deploy to gigalixir automatically when a branch is merged into master. Does that answer your question?

@nazarsh

This comment has been minimized.

Copy link

nazarsh commented Feb 16, 2020

Hey, sorry, I should have been more specific. The gist shows the use of actual gigalixir cli with email and password passed into it. Getting started guide relied on the API key and a remote configuration directly instead. Was just curious which would be a more canonical way of going about it?

@jesseshieh

This comment has been minimized.

Copy link
Owner Author

jesseshieh commented Feb 16, 2020

Oh I see. So it's a bit confusing, but when you git push, the only way to authenticate is by using your email and API key. One way to do that is by putting the credentials directly in the git remote url. Another way to do it is to save the credentials in a .netrc file which gigalixir login does for you. Either method is fine and neither is recommended. The only reason why we used the former is because you can get your first deploy done without ever installing the cli.

For a simple deploy script like this one, the former method might be easier, but as this script potentially gets more complicated, you might need other cli commands and then you'll probably need to use the latter method.

Does that answer your question?

@nazarsh

This comment has been minimized.

Copy link

nazarsh commented Feb 16, 2020

Perfect, thank you so much - that is exactly the kind of insight I was looking for!

@blakedietz

This comment has been minimized.

Copy link

blakedietz commented Feb 29, 2020

Just to be clear, there's no need to url escape your username as mentioned in the docs for gigalixir as in reference to the travis ci example right?

@jesseshieh

This comment has been minimized.

Copy link
Owner Author

jesseshieh commented Feb 29, 2020

Right. In this case, it's using a cli command to login so nothing needs to be escaped. It would need to be escaped if you used it in a git remote url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.