Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: debug container workflow #413

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:

context:
name: Context
needs: test
runs-on: ubuntu-latest

outputs:
Expand All @@ -72,28 +71,35 @@ jobs:

echo "type=development" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT
echo "On \`main\` Branch, Type: \`development\`"

fi
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
elif [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then

echo "type=development" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT
echo "On \`develop\` Branch, Type: \`development\`"

fi
if [[ "${{ github.ref }}" =~ ^(refs\/heads\/releases\/)(v)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]]; then
elif [[ "${{ github.ref }}" =~ ^(refs\/heads\/releases\/)(v)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]]; then

version=$(echo "${{ github.ref }}" | sed -n -E 's/^(refs\/heads\/releases\/)//p')
echo "version=$version" >> $GITHUB_OUTPUT
echo "type=release" >> $GITHUB_OUTPUT
echo "continue=true" >> $GITHUB_OUTPUT
echo "In \`releases/$version\` Branch, Type: \`release\`"

else
echo "Not Correct Branch. Will Not Continue"
fi
else
echo "Not a Push Event. Will Not Continue"
fi
else
echo "On a Forked Repository. Will Not Continue"
fi

secrets:
name: Secrets
needs: context
needs: [test, context]
environment: dockerhub-torrust
if: needs.context.outputs.continue == 'true'
runs-on: ubuntu-latest
Expand All @@ -112,7 +118,7 @@ jobs:
publish:
name: Publish
environment: dockerhub-torrust
needs: secrets
needs: [secrets, context]
if: needs.secrets.outputs.continue == 'true'
runs-on: ubuntu-latest

Expand Down
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dockerhub",
"downloadedi",
"dtolnay",
"elif",
"filesd",
"Freebox",
"gecos",
Expand Down