Skip to content

Commit

Permalink
checkout defang and samples in sibling directories
Browse files Browse the repository at this point in the history
to mirror the configuration in our development environments
  • Loading branch information
jordanstephens committed Aug 8, 2024
1 parent fc62c20 commit baf821d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ jobs:
uses: actions/checkout@v3
with:
repository: DefangLabs/defang
path: defang
path: ../defang
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.version || 'main' }}

- name: Checkout DefangLabs/samples
uses: actions/checkout@v3
with:
repository: DefangLabs/samples
path: samples
path: ../samples
ref: main

- name: Set up Go
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
uses: actions/checkout@v3
with:
repository: DefangLabs/defang
path: defang
path: ../defang
ref: main

- name: Checkout DefangLabs/samples
uses: actions/checkout@v3
with:
repository: DefangLabs/samples
path: samples
path: ../samples
ref: main

- name: Set up Go
Expand Down
2 changes: 1 addition & 1 deletion scripts/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

cd defang/src/cmd/gendocs && go run main.go ../../../defang-docs/docs/cli
cd ../defang/src/cmd/gendocs && go run main.go ../../../../defang-docs/docs/cli
cd -
node scripts/prep-cli-docs.js
node scripts/prep-samples.js
12 changes: 6 additions & 6 deletions scripts/prep-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');
const YAML = require('yaml');

const samplesDir = path.join(__dirname, '..', 'samples', 'samples');
const samplesDir = path.join(__dirname, '..', '..', 'samples', 'samples');

// categories are directories in the current directory (i.e. we're running in samples/ and we might have a samples/ruby/ directory)
const directories = fs.readdirSync(samplesDir).filter(file => fs.statSync(path.join(samplesDir, file)).isDirectory());
Expand All @@ -20,11 +20,11 @@ directories.forEach((sample) => {
}

// The readme should contain lines that start with the following:
// Title:
// Short Description:
// Tags:
// Languages:
//
// Title:
// Short Description:
// Tags:
// Languages:
//
// We want to extract the title, short description, tags, and languages from the readme. Tags and languages are comma separated lists.
const title = readme.match(/Title: (.*)/)[1];
const shortDescription = readme.match(/Short Description: (.*)/)[1];
Expand Down

0 comments on commit baf821d

Please sign in to comment.