You can put this custom file into the assets folder of the theme file assets/js/my-javascript-file.js
.
Then add the code to your expected page or theme file footer.
<script type="text/javascript " src="{{cdn 'assets/js/my-javascript-file.js'}}"></script>