43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
delete:
|
|
|
|
env:
|
|
PANGOLIN_API_URL: ${{ secrets.PANGOLIN_API_URL }}
|
|
PANGOLIN_API_KEY: ${{ secrets.PANGOLIN_API_KEY }}
|
|
PANGOLIN_ORG_ID: ${{ secrets.PANGOLIN_ORG_ID }}
|
|
PANGOLIN_DOMAIN_ID: ${{ secrets.PANGOLIN_DOMAIN_ID }}
|
|
PANGOLIN_SITE_ID: ${{ secrets.PANGOLIN_SITE_ID }}
|
|
PANGOLIN_TARGET_IP: ${{ secrets.PANGOLIN_TARGET_IP }}
|
|
|
|
jobs:
|
|
deploy:
|
|
if: github.event_name == 'push'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: https://git.zyrrus.dev/eighty-six/node-deploy-action/deploy@v1
|
|
with:
|
|
app-name: ${{ vars.APP_NAME }}
|
|
branch: ${{ github.ref_name }}
|
|
env-vars: |
|
|
DATABASE_URL=${{ secrets.DATABASE_URL }}
|
|
API_KEY=${{ secrets.API_KEY }}
|
|
|
|
cleanup-preview:
|
|
if: github.event_name == 'delete' && github.event.ref_type == 'branch'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
|
|
- uses: https://git.zyrrus.dev/eighty-six/node-deploy-action/cleanup@v1
|
|
with:
|
|
app-name: ${{ vars.APP_NAME }}
|
|
branch: ${{ github.event.ref }}
|