surge
surge copied to clipboard
Support token auth for easy usages through CI/CD
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
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
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
@Mahmoudgalalz thanks for sharing Do you know https://github.com/afc163/surge-preview/?
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
Nice 😊
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.