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

cp: can't create '/.git': File exists | Error on user type repository deployment #45

Closed
asurbernardo opened this issue Oct 22, 2019 · 3 comments
Labels

Comments

@asurbernardo
Copy link

@asurbernardo asurbernardo commented Oct 22, 2019

Hello I found a recurring error when I try to deploy to my user type repository.

Stack trace:

/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/blog/blog":"/github/workspace" fbc64f:bd4f8c40a2ff4d509a3eda2d208b73d4
INFO: Deploy to asurbernardo/asurbernardo.github.io
INFO: setup with ACTIONS_DEPLOY_KEY
# github.com:22 SSH-2.0-babeld-85ff8279
Cloning into '/github/home/ghpages_12475'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
rm '404.html'
rm 'CNAME'
rm 'README.md'
rm 'commento.html'
rm 'images/design-inspiration.jpg'
rm 'index.html'
rm 'index.xml'
rm 'install-sw.html'
rm 'manifest.json'
rm 'offline.html'
rm 'posts/el-primer-post-en-mi-nuevo-blog/index.html'
rm 'posts/index.html'
rm 'posts/index.xml'
rm 'posts/la-primera-iteracion-amp-estilos-y-miscelanea/index.html'
rm 'posts/mi-primer-post/index.html'
rm 'sitemap.xml'
rm 'sw.js'
rm 'tags/deploy/index.html'
rm 'tags/deploy/index.xml'
rm 'tags/evolutivo/index.html'
rm 'tags/evolutivo/index.xml'
rm 'tags/git/index.html'
rm 'tags/git/index.xml'
rm 'tags/index.html'
rm 'tags/index.xml'
rm 'tags/iteracion/index.html'
rm 'tags/iteracion/index.xml'
rm 'tags/iteración/index.html'
rm 'tags/iteración/index.xml'
cp: can't create '/github/home/ghpages_12475/.git': File exists
##[error]Docker run failed with exit code 123

My action main.yml:

name: Deploy blog
on:
  push:
    branches:
    - master

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    steps:

    - name: Pull source
      uses: actions/checkout@master
      with:
        submodules: true

    - name: Update submodules to latests master
      run: git submodule update --remote

    - name: Setup Hugo
      uses: peaceiris/actions-hugo@v2.2.2
      with:
        hugo-version: '0.58.3'
        extended: true

    - name: Build
      run: hugo -t amperage --gc --minify

    - name: Deploy script
      uses: peaceiris/actions-gh-pages@v2.5.0
      env:
        ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
        EXTERNAL_REPOSITORY: asurbernardo/asurbernardo.github.io
        PUBLISH_BRANCH: master
        PUBLISH_DIR: ./public

I think I've followed the guide correctly, but maybe I'm missing something.

@peaceiris

This comment has been minimized.

Copy link
Owner

@peaceiris peaceiris commented Oct 22, 2019

blog/.gitmodules at master · asurbernardo/blog

Your asurbernardo/blog includes public as a submodule. It should be removed from your blog repo.

@peaceiris

This comment has been minimized.

Copy link
Owner

@peaceiris peaceiris commented Oct 22, 2019

BTW, your blog repo and github.io repo are public repositories. How about merging blog repo into the github.io repo? The following repositories are good references for you.

@asurbernardo

This comment has been minimized.

Copy link
Author

@asurbernardo asurbernardo commented Oct 22, 2019

Thank you so much @peaceiris, I had to restructure the project, the submodule was exactly the reason why it was failing.

I have my blog repository public because I'm documenting its own evolution, I know I could merge them, maybe in the future I will change my mind, but for now I will keep the like that :)

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