forked from datajoint/element-array-ephys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request datajoint#56 from yambottle/main
U24 workflow CICD
- Loading branch information
Showing
15 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
.github/.staging_workflows/anchored_u24_workflow_before_release.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: u24_workflow_before_release | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
anchor-dev-build-call: &dev-build-call | ||
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
|
||
anchor-test-build-call: &test-build-call | ||
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
|
||
anchor-prod-build-call: &prod-build-call | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
|
||
jobs: | ||
call_context_check: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main | ||
|
||
call_u24_workflow_build_debian: | ||
!!merge <<: *$STAGE-build-call | ||
with: | ||
jhub_ver: 1.4.2 | ||
py_ver: 3.9 | ||
dist: debian | ||
codebook_base_hash: 561b765 |
47 changes: 47 additions & 0 deletions
47
.github/.staging_workflows/anchored_u24_workflow_release_call.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: u24_workflow_release_call | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["u24_workflow_tag_to_release"] | ||
types: | ||
- completed | ||
|
||
anchor-dev-release-call: &dev-release-call | ||
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main | ||
|
||
anchor-test-release-call: &test-release-call | ||
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main | ||
|
||
anchor-prod-release-call: &prod-release-call | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main | ||
|
||
anchor-dev-release-if: &dev-release-if | ||
if: >- | ||
github.event.workflow_run.conclusion == 'success' && | ||
github.repository_owner == 'yambottle' | ||
anchor-test-release-if: &test-release-if | ||
if: >- | ||
github.event.workflow_run.conclusion == 'success' && | ||
github.repository_owner == 'yambottle' | ||
anchor-prod-release-if: &prod-release-if | ||
if: >- | ||
github.event.workflow_run.conclusion == 'success' && | ||
github.repository_owner == 'datajoint' | ||
jobs: | ||
call_context_check: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main | ||
|
||
call_u24_workflow_release_debian: | ||
!!merge <<: *$STAGE-release-if | ||
!!merge <<: *$STAGE-release-call | ||
with: | ||
jhub_ver: 1.4.2 | ||
py_ver: 3.9 | ||
dist: debian | ||
codebook_base_hash: 561b765 | ||
secrets: | ||
REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} |
27 changes: 27 additions & 0 deletions
27
.github/.staging_workflows/anchored_u24_workflow_tag_to_release.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: u24_workflow_tag_to_release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
- 'test*.*.*' | ||
|
||
anchor-dev-build-call: &dev-build-call | ||
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
|
||
anchor-test-build-call: &test-build-call | ||
uses: yambottle/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
|
||
anchor-prod-build-call: &prod-build-call | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
|
||
jobs: | ||
call_context_check: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main | ||
call_u24_workflow_build_debian: | ||
!!merge <<: *$STAGE-build-call | ||
with: | ||
jhub_ver: 1.4.2 | ||
py_ver: 3.9 | ||
dist: debian | ||
codebook_base_hash: 561b765 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
# For Github Action that doesn't support anchor yet... | ||
# https://github.com/actions/runner/issues/1182 | ||
|
||
STAGE=$1 | ||
# .yaml in .staging_workflows has to be named using a prefix 'anchored_', this will be removed when normalizing | ||
PREFIX="anchored_" | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
for source in $(ls $SCRIPT_DIR | grep yaml) | ||
do | ||
target=${source#$PREFIX} | ||
export STAGE | ||
envsubst '${STAGE}' < $SCRIPT_DIR/$source | yq e 'explode(.) | del(.anchor-*)' > $SCRIPT_DIR/../workflows/$target | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
RAW_DEPLOY_KEY= | ||
GITHUB_TOKEN= | ||
REGISTRY_USERNAME= | ||
REGISTRY_PASSWORD= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
For local testing using act, you need to create few things: | ||
- make a `.test/artifacts` dir for `act --artifact-server-path ./.test/artifacts/` | ||
- make a `.test/.secrets` file similar as `.env` for `act --secret-file ./.test/.secrets` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bash ./.staging_workflows/normalize.sh dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bash ./.staging_workflows/normalize.sh prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bash ./.staging_workflows/normalize.sh test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
bash $SCRIPT_DIR/.staging_workflows/normalize.sh dev | ||
cd .. | ||
act -P ubuntu-latest=drewyangdev/ubuntu:act-latest \ | ||
--secret-file $SCRIPT_DIR/.test/.secrets \ | ||
--artifact-server-path $SCRIPT_DIR/.test/artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: u24_workflow_before_release | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
workflow_dispatch: | ||
jobs: | ||
call_context_check: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main | ||
call_u24_workflow_build_debian: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
with: | ||
jhub_ver: 1.4.2 | ||
py_ver: 3.9 | ||
dist: debian | ||
codebook_base_hash: 561b765 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: u24_workflow_release_call | ||
on: | ||
workflow_run: | ||
workflows: ["u24_workflow_tag_to_release"] | ||
types: | ||
- completed | ||
jobs: | ||
call_context_check: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main | ||
call_u24_workflow_release_debian: | ||
if: >- | ||
github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'datajoint' | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_release.yaml@main | ||
with: | ||
jhub_ver: 1.4.2 | ||
py_ver: 3.9 | ||
dist: debian | ||
codebook_base_hash: 561b765 | ||
secrets: | ||
REGISTRY_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
REGISTRY_PASSWORD: ${{secrets.DOCKER_PASSWORD}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: u24_workflow_tag_to_release | ||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
- 'test*.*.*' | ||
jobs: | ||
call_context_check: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/context_check.yaml@main | ||
call_u24_workflow_build_debian: | ||
uses: dj-sciops/djsciops-cicd/.github/workflows/u24_workflow_build.yaml@main | ||
with: | ||
jhub_ver: 1.4.2 | ||
py_ver: 3.9 | ||
dist: debian | ||
codebook_base_hash: 561b765 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,5 +100,8 @@ Diagram.ipynb | |
|
||
# docker, vscode | ||
.env | ||
*.pem | ||
|
||
# vscode | ||
docker-compose.yml | ||
.vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters