vitalyliber / dokku-github-action

Deploy applications to Dokku
https://vitalyliber.com/courses/deploj-prilozhenij-s-dokku
MIT License
78 stars 32 forks source link

Failing for non master branches #20

Closed aalemayhu closed 4 years ago

aalemayhu commented 4 years ago

Hei there 👋🏾

Love this action. It mostly works fine, but when I use for a dev branch it fails a lot. Do you have any ideas why? Thanks 🙏🏾

Here is also the latest failure https://github.com/alemayhu/notion2anki/actions/runs/251606558

Below is the configuration I use

name: Deploy to dev.2anki.net

on:
  push:
    branches:
      - dev

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Dokku deploy
      uses: vitalyliber/dokku-github-action@v4.0
      env:
        PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
        HOST: 2anki.net
        PROJECT: dev.notion
gustavohwulee commented 4 years ago

Try forcing the first deploy. Add FORCE_DEPLOY: true to env

vitalyliber commented 4 years ago

@aalemayhu did you try adding FORCE_DEPLOY: true to ENV?

aalemayhu commented 4 years ago

No, it sounds dangerous.

vitalyliber commented 4 years ago

@aalemayhu this is not dokku or dokku-github-action issue. Please see https://stackoverflow.com/questions/39399804/updates-were-rejected-because-the-tip-of-your-current-branch-is-behind-its-remot

aalemayhu commented 4 years ago

I will go ahead and close this and just keep doing it manually locally (git push dev.notion dev:master), thanks!

bjornpost commented 4 years ago

Hi all! At first I ran into the same issue as aalemayhu. Adding FORCE_DEPLOY fixed the issue of not being able to push. But now, after the deploy has finished, I'm getting a shallow update not allowed error (causing the workflow to fail):

...
remote:        Renaming container (yadda) gifted_swanson to myapp.web.1        
remote: -----> Shutting down old containers in 60 seconds        
remote:        yadda        
remote: =====> Application deployed:        
remote:        http://myapp.example.com        
remote:        https://myapp.example.com        
remote:         
To dokku.example.com:myapp
 ! [remote rejected] next -> master (shallow update not allowed) <---
error: failed to push some refs to 'dokku@dokku.example.com:myapp'

Any ideas?

gustavohwulee commented 4 years ago

Hi all! At first I ran into the same issue as aalemayhu. Adding FORCE_DEPLOY fixed the issue of not being able to push. But now, after the deploy has finished, I'm getting a shallow update not allowed error (causing the workflow to fail):

...
remote:        Renaming container (yadda) gifted_swanson to myapp.web.1        
remote: -----> Shutting down old containers in 60 seconds        
remote:        yadda        
remote: =====> Application deployed:        
remote:        http://myapp.example.com        
remote:        https://myapp.example.com        
remote:         
To dokku.example.com:myapp
 ! [remote rejected] next -> master (shallow update not allowed) <---
error: failed to push some refs to 'dokku@dokku.example.com:myapp'

Any ideas?

Add fetch-depth: 0 in your .yml file

l3d00m commented 3 years ago

I opened an issue for the case described by @bjornpost: https://github.com/dokku/dokku/issues/4405, but fetch-depth: 0 is a good workaround.