-
-
Notifications
You must be signed in to change notification settings - Fork 119
GitHub actions for newsite branch #46
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
Changes from all commits
2af4bcd
82d2b21
590fd00
74e4a12
e073a72
9a0c948
ddd3647
a524608
45158ce
831b49d
7af6ac2
b38d9d4
b487dba
b5a7ccb
676cf65
d48c5ae
5477185
61ea985
13dd632
0e57ed8
3c1de08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: 'deploy-action' | ||
description: 'Install, Build and deploy hugo app in surge' | ||
outputs: | ||
deployed-domain: # id of output | ||
description: 'Surge deploy domain URL.' | ||
runs: | ||
using: 'docker' | ||
image: '../../../Dockerfile' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- newsite | ||
|
||
push: | ||
branches: | ||
- newsite | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy on surge | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: | ||
- 10 | ||
python-version: | ||
- 3.7 | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: deploy in surge | ||
uses: ./.github/actions/deploy-action | ||
id: deploy | ||
env: | ||
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN}} | ||
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN}} | ||
REF: ${{ github.ref}} | ||
- name: Get the deployed-domain | ||
run: echo "The deployed-domain is ${{ steps.deploy.outputs.deployed-domain }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,204 @@ | ||
.DS_Store | ||
*.swp | ||
*.pyd | ||
*.so | ||
*.o | ||
*.lo | ||
*.la | ||
*~ | ||
*.bak | ||
*.swp | ||
.\#* | ||
.deps | ||
.libs | ||
.tox | ||
*/**/_build | ||
*/**/build | ||
__pycache__ | ||
**/*.egg-info | ||
/dist | ||
|
||
|
||
.mypy_cache | ||
*/*.pyc | ||
*/*.so* | ||
*/**/__pycache__ | ||
*/**/*.dylib* | ||
*/**/*.pyc | ||
*/**/*.pyd | ||
*/**/*.so* | ||
*/**/**/*.pyc | ||
*/**/**/**/*.pyc | ||
*/**/**/**/**/*.pyc | ||
|
||
*/**/make.dat | ||
|
||
*.egg-info | ||
*.egg | ||
*build/ | ||
.tox | ||
.coverage | ||
*.DS_Store | ||
*.sass-cache | ||
*.map | ||
.ropeproject/ | ||
.ruby-version | ||
dist/ | ||
bower_components/ | ||
node_modules | ||
npm-debug.log | ||
package-lock.json | ||
|
||
|
||
# IPython notebook checkpoints | ||
.ipynb_checkpoints | ||
|
||
# Editor temporaries | ||
*.swn | ||
*.swo | ||
*.swp | ||
*.swm | ||
*~ | ||
|
||
# macOS dir files | ||
.DS_Store | ||
|
||
# Symbolic files | ||
tools/shared/cwrap_common.py | ||
|
||
# Ninja files | ||
.ninja_deps | ||
.ninja_log | ||
compile_commands.json | ||
*.egg-info/ | ||
docs/source/scripts/activation_images/ | ||
|
||
## General | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.cuo | ||
*.obj | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Compiled protocol buffers | ||
*.pb.h | ||
*.pb.cc | ||
*_pb2.py | ||
|
||
# Compiled python | ||
*.pyc | ||
*.pyd | ||
|
||
# Compiled MATLAB | ||
*.mex* | ||
|
||
# IPython notebook checkpoints | ||
.ipynb_checkpoints | ||
|
||
# Editor temporaries | ||
*.swn | ||
*.swo | ||
*.swp | ||
*~ | ||
|
||
# Sublime Text settings | ||
*.sublime-workspace | ||
*.sublime-project | ||
|
||
# Eclipse Project settings | ||
*.*project | ||
.settings | ||
|
||
# QtCreator files | ||
*.user | ||
|
||
# PyCharm files | ||
.idea | ||
|
||
# OSX dir files | ||
.DS_Store | ||
|
||
# GDB history | ||
.gdb_history | ||
|
||
## Caffe2 | ||
|
||
# build, distribute, and bins (+ python proto bindings) | ||
build | ||
build_host_protoc | ||
build_android | ||
build_ios | ||
/build_* | ||
.build_debug/* | ||
.build_release/* | ||
distribute/* | ||
*.testbin | ||
*.bin | ||
cmake_build | ||
.cmake_build | ||
gen | ||
.setuptools-cmake-build | ||
.pytest_cache | ||
aten/build/* | ||
|
||
# Bram | ||
plsdontbreak | ||
|
||
# Generated documentation | ||
docs/_site | ||
docs/gathered | ||
_site | ||
doxygen | ||
docs/dev | ||
|
||
# LevelDB files | ||
*.sst | ||
*.ldb | ||
LOCK | ||
CURRENT | ||
MANIFEST-* | ||
|
||
# generated version file | ||
caffe2/version.py | ||
|
||
# setup.py intermediates | ||
.eggs | ||
caffe2.egg-info | ||
|
||
# Atom/Watchman required file | ||
.watchmanconfig | ||
|
||
# Files generated by CLion | ||
cmake-build-debug | ||
|
||
# Files generated by ctags | ||
CTAGS | ||
tags | ||
TAGS | ||
|
||
# BEGIN NOT-CLEAN-FILES (setup.py handles this marker. Do not change.) | ||
# | ||
# Below files are not deleted by "setup.py clean". | ||
|
||
# Visual Studio Code files | ||
.vscode | ||
.vs | ||
|
||
# YouCompleteMe config file | ||
.ycm_extra_conf.py | ||
|
||
# Files generated when a patch is rejected | ||
*.orig | ||
*.rej |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
hugo |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
npm install -g surge | ||
|
||
echo "REF value is ${REF}" | ||
|
||
PR_NUMBER="$(echo $REF | cut -d'/' -f3)" | ||
echo "PR_NUMBER: $PR_NUMBER" | ||
|
||
|
||
surge --project "./public" --domain "pr-${PR_NUMBER}-numpy.org-newsite.surge.sh"; | ||
|
||
echo ::set-output name=deployed-domain::"pr-${PR_NUMBER}-numpy.org-newsite.surge.sh" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \ | ||
| grep "browser_download_url.*hugo_[^extended].*_Linux-64bit\.tar\.gz" \ | ||
| cut -d ":" -f 2,3 \ | ||
| tr -d \" \ | ||
| wget -qi - | ||
|
||
tarball="$(find . -name "*Linux-64bit.tar.gz")" | ||
|
||
tar -xzf $tarball | ||
|
||
chmod +x hugo | ||
|
||
mv hugo /usr/local/bin/ | ||
|
||
location="$(which hugo)" | ||
echo "Hugo binary location: $location" | ||
|
||
version="$(hugo version)" | ||
echo "Hugo binary version: $version" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM node:10-alpine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need node alpine? We might be able to use another image (something smaller, if it exists), although it probably doesn't really matter :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. node docker image is used because later in deploy script it is installing the surge package. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It maybe doesn't matter here, but Alpine is one of the most problematic distributions for Python packages, because it's musl rather than glibc based so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the info. |
||
ADD . ./app | ||
WORKDIR /app | ||
|
||
RUN apk add --no-cache curl | ||
RUN apk add --no-cache wget | ||
RUN apk add --no-cache bash | ||
|
||
RUN chmod +x .scripts/install.sh | ||
RUN chmod +x .scripts/build.sh | ||
RUN chmod +x .scripts/deploy.sh | ||
|
||
RUN .scripts/install.sh | ||
RUN .scripts/build.sh | ||
|
||
RUN echo ${REF} | ||
RUN echo "$REF" | ||
RUN export PR_NUMBER=$(echo ${REF} | cut -d'/' -f3) | ||
|
||
ENTRYPOINT .scripts/deploy.sh; /bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here.