Skip to content

Commit d557c64

Browse files
committed
👷 Skip stages for tags
1 parent 878fefb commit d557c64

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ workflows:
1717
pre-steps:
1818
- run:
1919
command: |
20-
echo '{ "owner": "'${CIRCLE_PROJECT_USERNAME}'", "branch": "'${CIRCLE_BRANCH}'", "tag": "'${CIRCLE_TAG}'"}' >> /home/circleci/test.json
20+
echo '{ "owner": "'${CIRCLE_PROJECT_USERNAME}'", "branch": "'${CIRCLE_BRANCH}'", "tag": "'${CIRCLE_TAG}'" }' >> /home/circleci/test.json
2121
cat /home/circleci/test.json

.github/workflows/check_updated_version.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
git config --global user.email "[email protected]"
2020
git config --global user.name "Theodore (Machine User)"
2121
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-)
22-
if [[ $GITHUB_BRANCH == 'main' ]]
22+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]
2323
then
2424
cd $HOME/work/C-PAC/C-PAC
2525
for DOCKERFILE in $(ls .github/Dockerfiles/C-PAC.develop-*.Dockerfile)
@@ -70,6 +70,7 @@ jobs:
7070
with:
7171
fetch-depth: 2
7272
- name: Build stages
73+
if: github.ref_type == 'branch'
7374
run: |
7475
pip install PyGithub
7576
BASE_REFS=$(python .github/scripts/get_pr_base_shas.py)
@@ -86,3 +87,10 @@ jobs:
8687
fi
8788
env:
8889
GITHUB_TOKEN: ${{ secrets.ACTIONS_WORKFLOW_TOKEN }}
90+
- name: Build, test, and push C-PAC
91+
if: github.ref_type == 'tag'
92+
run: |
93+
pip install PyGithub
94+
gh workflow run build_and_test.yml --ref ${GITHUB_REF_NAME}
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.ACTIONS_WORKFLOW_TOKEN }}

0 commit comments

Comments
 (0)