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

Support token auth for easy usages through CI/CD #507

Open
Mahmoudgalalz opened this issue Jul 3, 2023 · 6 comments
Open

Support token auth for easy usages through CI/CD #507

Mahmoudgalalz opened this issue Jul 3, 2023 · 6 comments

Comments

@Mahmoudgalalz
Copy link

Hello @sintaxi I'm asking if you are interested to support a GitHub Action for Auto deployment, I'm building one for general purpose

so if you are interested to support it it will be very great.

also Tagging the issue it will be more easy if we have a token to authenticate

@Mahmoudgalalz
Copy link
Author

when I explored the code, I found there's another way to auth which is a token, and there's another flag that gives you your token, so I will be finishing working on the action today.

waiting to hear from you

@Mahmoudgalalz
Copy link
Author

initially I build this and its work, there's some features will be added, like creating a 200.html and inject it to the dist forlder
another feature, like usage of random domains, and 2sub-domain for both dev, and PR

this the usage of the action

on:
  push:
    branches: [ main ]

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    name: Build the code
    steps:
      - name: checkout the project
        uses: actions/checkout@v3
      - name: install deps
        uses: actions/setup-node@v3
        with:
          node-version: v16.x
      - name: build the project
        run: |
         npm install -g pnpm
         pnpm i
         npm run build
         
      - name: deploying to surge
        uses: mahmoudgalalz/[email protected]
        with:
          domain: 'ghtop.surge.sh'
          path: './dist'
        env:
          SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}

https://github.com/mahmoudgalalz/surge-action

@tbouffard
Copy link

@Mahmoudgalalz thanks for sharing
Do you know https://github.com/afc163/surge-preview/?

@Mahmoudgalalz
Copy link
Author

I kept looking for smth like that, and I was going to implement the same feature on my own, so I think I should suggest adding my own current feature into it
@tbouffard

@tbouffard
Copy link

Nice 😊

@tbouffard
Copy link

also Tagging the issue it will be more easy if we have a token to authenticate

It is already possible to use a token to perform actions with the surge CLI. All commands support the --token <token_value> option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants