Skip to content

Commit f81ec47

Browse files
authored
Merge pull request #618 from DefangLabs/lio/template-deploy-yaml
chore: use a single deploy workflow template
2 parents 160a3f5 + 6db2039 commit f81ec47

89 files changed

Lines changed: 848 additions & 1736 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-sample.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check Samples
33
on:
44
pull_request:
55
paths:
6-
- 'samples/**'
6+
- "samples/**"
77

88
jobs:
99
check_samples:
@@ -13,19 +13,20 @@ jobs:
1313
pull-requests: write
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
# Fetch two to see changes in current commit
1919
fetch-depth: 2
2020

21-
- name: Install Defang
21+
- name: Install Defang (nightly)
2222
run: |
2323
eval "$(curl -fsSL s.defang.io/install)"
24+
env:
25+
DEFANG_INSTALL_VERSION: nightly
2426

2527
- name: Run Checks
2628
id: checks
2729
run: |
28-
eval "$(curl -fsSL s.defang.io/install)"
2930
./scripts/check-sample-files.sh > checklist.txt
3031
./scripts/check-modified-samples.sh > modified.txt
3132
echo "@@ MODIFIED @@"

.github/workflows/publish-sample-template.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
name: Publish Sample Template
22

33
on:
4-
push:
4+
push:
55
branches:
66
- main
77

88
jobs:
99
publish_samples:
1010
runs-on: ubuntu-latest
11-
permissions:
11+
permissions:
1212
contents: write
1313
pull-requests: write
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
# Fetch two to see changes in current commit
1919
fetch-depth: 2

.github/workflows/test-scripts.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Test Scripts
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- "scripts/**"
10+
- "templates/**"
11+
- "samples/**/compose.yaml"
12+
- "samples/**/compose.yml"
13+
push:
14+
branches:
15+
- main
16+
paths:
17+
- "scripts/**"
18+
- "templates/**"
19+
20+
jobs:
21+
test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "20"
31+
32+
- name: Install dependencies
33+
run: npm install
34+
working-directory: scripts
35+
36+
- name: Run tests
37+
run: npm test
38+
working-directory: scripts
39+
40+
preview-workflows:
41+
if: github.event_name == 'pull_request'
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 2
48+
49+
- name: Set up Node.js
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: "20"
53+
54+
- name: Install dependencies
55+
run: npm install
56+
working-directory: scripts
57+
58+
- name: Get changed samples
59+
run: ./scripts/check-modified-samples.sh > modified.txt
60+
61+
- name: Preview workflows
62+
uses: actions/github-script@v7
63+
env:
64+
DRY_RUN: "true"
65+
with:
66+
script: |
67+
const script = require('./scripts/template-manager.js')
68+
await script({github, context, core});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update Template Workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "templates/deploy.yaml"
9+
workflow_dispatch:
10+
11+
jobs:
12+
update_workflows:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: "20"
24+
25+
- name: Install dependencies
26+
run: npm install
27+
working-directory: scripts
28+
29+
- name: Update Template Workflows
30+
uses: actions/github-script@v7
31+
env:
32+
PUSH_TOKEN: ${{ secrets.TEMPLATES_MANAGER_TOKEN }}
33+
with:
34+
github-token: ${{ secrets.TEMPLATES_MANAGER_TOKEN }}
35+
script: |
36+
const script = require('./scripts/update-template-workflows.js')
37+
await script({github, context, core});

samples/agentic-autogen/.github/workflows/deploy.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

samples/agentic-langgraph/.github/workflows/deploy.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

samples/agentic-strands/.github/workflows/deploy.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

samples/angular-express/.github/workflows/deploy.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

samples/arduino-wifi/.github/workflows/deploy.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

samples/bullmq-bullboard-redis/.github/workflows/deploy.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)