0

Project is on the branch main. Deployment on branch gh-pages from path: ~./project_name/output at push to main. System: ubuntu 20.04 to wsl2. Which paths(parameters) should be specified for the cp -r command to avto-deploy to github pages? From the log:

Push
Run run: |
/home/runner/work/_temp/9db87e3f-eb64-4189-a66b-8e958587ada6.sh: line 1: run:: command not found
warning: re-init: ignored --initial-branch=gh-pades
Reinitialized existing Git repository in /home/runner/work/project_name/project_name/.git/
cp: cannot stat '~./project_name/*': No such file or directory
Error: Process completed with exit code 1.

file content ~./project_name/. github/workflows/main.yml:

name: Deploy to GitHub pages

on: push: branches: - main

jobs: deploy: environment: production runs-on: ubuntu-latest permissions: contents: write packages: write
steps: - uses: actions/checkout@v2 with: persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.

  - name: Setup Ruby
    uses: ruby/setup-ruby@v1
    with:
      bundler-cache: true

  - name: Setup Node
    uses: actions/setup-node@v2
    with:
      node-version: "16"
      cache: "yarn"
  - run: yarn install

  - name: Build
    run: bin/bridgetown deploy

  - name: Push
    run: |
      run: |
      cd output
      git config --global user.email "useremail"
      git config --global user.name "username"
      git init --initial-branch=gh-pades
      touch ./.nojekyll
      cp -r ~./project_name/* ./
      git add -A
      git commit -m 'deploy'
      git push -f https://username:${{ secrets.GITHUB_TOKEN }}@github.com/username/project_name.git gh-pages

1 Answers1

0
-          cp -r ~./project_name/* ./
+          cp -r ~/project_name/* ./

Instead of ~./, you probably want ~/ to refer to your home directory in an absolute way or ./ to referr to your current directory in a relative way.

Zoyolin
  • 69