-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CI to deploy ioc-template-example
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
on: | ||
workflow_call: | ||
outputs: | ||
branch-pr: | ||
description: The PR number if the branch is in one | ||
value: ${{ jobs.pr.outputs.branch-pr }} | ||
|
||
jobs: | ||
pr: | ||
runs-on: "ubuntu-latest" | ||
outputs: | ||
branch-pr: ${{ steps.script.outputs.result }} | ||
steps: | ||
- uses: actions/github-script@v7 | ||
id: script | ||
if: github.event_name == 'push' | ||
with: | ||
script: | | ||
const prs = await github.rest.pulls.list({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
head: context.repo.owner + ':${{ github.ref_name }}' | ||
}) | ||
if (prs.data.length) { | ||
console.log(`::notice ::Skipping CI on branch push as it is already run in PR #${prs.data[0]["number"]}`) | ||
return prs.data[0]["number"] | ||
} |
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,34 @@ | ||
on: | ||
workflow_call: | ||
secrets: | ||
EXAMPLE_DEPLOY_KEY: | ||
required: true | ||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Need this to get version number from last tag | ||
fetch-depth: 0 | ||
|
||
- name: Regenerate example | ||
run: | | ||
pipx run copier copy --data-file example-answers.yml --trust --vcs-ref=HEAD . example | ||
- name: Rewrite copier answers | ||
run: | | ||
sed -i 's|_src_path: .|_src_path: gh:epics-containers/ioc-template|' example/.copier-answers.yml | ||
- name: Publish example | ||
# We pin to the SHA, not the tag, for security reasons. | ||
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions | ||
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 | ||
with: | ||
deploy_key: ${{ secrets.EXAMPLE_DEPLOY_KEY }} | ||
publish_dir: example | ||
external_repository: epics-containers/ioc-template-example | ||
publish_branch: main | ||
exclude_assets: '' # default would exclude .github |
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: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
uses: ./.github/workflows/_check.yml | ||
|
||
example: | ||
needs: test | ||
if: github.ref_name == 'main' | ||
uses: ./.github/workflows/_example.yml | ||
secrets: | ||
EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }} |
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,9 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: 3.5.0 | ||
_src_path: ioc-template | ||
description: A test instantiation of the ioc-template copier template | ||
git_platform: github.com | ||
github_org: epics-containers | ||
name: ioc-template-example | ||
repo_uri: [email protected]:epics-containers/ioc-template-example.git | ||
rtems: false |