mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-08-12 18:25:15 +00:00
New CI
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
name: Checks
|
||||
|
||||
on: [pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
- run: bun install
|
||||
- name: Run tests
|
||||
run: bun test
|
||||
@@ -1,30 +0,0 @@
|
||||
name: Publish records
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.repository == 'is-a-dev/register'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
- run: bun install
|
||||
- run: bun test
|
||||
- name: Publishing records
|
||||
env:
|
||||
CI: 1
|
||||
NODE_ENV: production
|
||||
ENV: production
|
||||
DOMAIN_USER: ${{ secrets.DOMAIN_USER }}
|
||||
DOMAIN_API_KEY: ${{ secrets.DOMAIN_API_KEY }}
|
||||
DOMAIN_API_HOST: ${{ secrets.DOMAIN_API_HOST }}
|
||||
DOMAIN_API_PORT: ${{ secrets.DOMAIN_API_PORT }}
|
||||
DOMAIN_DOMAIN: ${{ secrets.DOMAIN_DOMAIN }}
|
||||
DOMAIN_HOST_IP: ${{ secrets.DOMAIN_HOST_IP }}
|
||||
run: bun run publish-records
|
||||
@@ -0,0 +1,32 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "domains/**"
|
||||
- ".github/workflows/publish.yml"
|
||||
- "dnsconfig.js"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-publish
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
dns:
|
||||
name: DNS
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: echo '{"cloudflare":{"TYPE":"CLOUDFLAREAPI","apitoken":"$CLOUDFLARE_API_TOKEN"}}' > ./creds.json
|
||||
|
||||
- name: Publish
|
||||
uses: koenrh/dnscontrol-action@v3
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
|
||||
with:
|
||||
args: push
|
||||
config_file: "dnsconfig.js"
|
||||
@@ -0,0 +1,43 @@
|
||||
name: Validation
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "domains/**"
|
||||
- ".github/workflows/validation.yml"
|
||||
- "dnsconfig.js"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-validation
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
dns:
|
||||
name: DNS
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check
|
||||
uses: koenrh/dnscontrol-action@v3
|
||||
with:
|
||||
args: check
|
||||
config_file: "dnsconfig.js"
|
||||
|
||||
json:
|
||||
name: JSON
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: JSON Syntax Check
|
||||
uses: limitusus/json-syntax-check@v2
|
||||
with:
|
||||
pattern: "\\.json$"
|
||||
env:
|
||||
BASE: "domains/"
|
||||
Reference in New Issue
Block a user