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

Deployment is always done on the same branch refs/heads/develop #48

Closed
mathieucollet opened this issue Nov 1, 2020 · 2 comments
Closed
Assignees
Labels
Type: Question Further information is requested

Comments

@mathieucollet
Copy link

mathieucollet commented Nov 1, 2020

Hi there,

I'm trying to set up the deployment of my develop branch and my master branch.

Despite the -m githubCommitRef=refs/heads/master parameter which appears in the command passed by Vercel-Action, it is the refs/head/develop branch which appears in the Vercel dashboard.

As a result, Vercel does not build the application and only change the domain of the previous deployment from develop -..... vercel.app to master -..... vercel.app

Here is the part of Yaml that interests us:

cd:
    needs: ci
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: amondnet/vercel-action@v19
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
          vercel-org-id: ${{ secrets.ORG_ID}}  #Required
          scope: 'slinkcorp'
          vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
          working-directory: ./
          alias-domains: |
            {{BRANCH}}-slink-front.vercel.app

And the vercel.json too:

{
  "version": 2,
  "github": {
    "enabled": false
  },
  "builds": [
    {
      "src": "nuxt.config.js",
      "use": "@nuxtjs/vercel-builder"
    }
  ]
}

Any idea of what I'm doing wrong?

@amondnet
Copy link
Owner

amondnet commented Nov 9, 2020

@mathieucollet

Is there any change in files?

https://vercel.com/docs/api#endpoints/deployments/create-a-new-deployment/force-a-new-deployment

Deploying again with the same request would yield the same response, with the same ID and URL due to no differences to the files or configuration.

https://vercel.com/docs/cli#options/global-options/force

The --force option, shorthand -f, is used either to force a deployment where there have been no changes or to forcibly replace an existing local directory.

Try using the --force option.

      - uses: amondnet/vercel-action@v19
         with:
           // your config
           vercel-args: --force // use --force option

@amondnet amondnet self-assigned this Nov 9, 2020
@amondnet amondnet added the Type: Question Further information is requested label Nov 9, 2020
@mathieucollet
Copy link
Author

mathieucollet commented Nov 9, 2020

Indeed, there were no changes in the files, because it was a merge of develop to main. But I was trying to keep the two branches deployed.

Thanks for the -f trick, it does the job indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants