Created
October 10, 2020 00:38
-
-
Save takahirohonda/2d3ff05aad404434965e35d3b2e7480c to your computer and use it in GitHub Desktop.
Github page deploy git hub actions example
This file contains hidden or 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
name: Deploy to GitHub Page | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Install | |
run: | | |
cd code | |
npm i | |
cd .. | |
- name: Unit-Tests | |
run: | | |
cd code | |
npm run test-single-run | |
cd .. | |
- name: Build-Assets | |
run: | | |
cd code | |
npm run deploy:prod | |
cd .. | |
pwd | |
- name: Set-Base-Url | |
run: | | |
cd deploy-scripts | |
node add-base-url.js | |
cd .. | |
pwd | |
- name: Build-Jekyll | |
run: | | |
sudo apt-get install ruby-full | |
sudo gem install bundler | |
sudo bundle install | |
bundle exec jekyll build | |
- name: Deploy_To_GithubPage | |
uses: JamesIves/[email protected] | |
with: | |
ACCESS_TOKEN: ${{ secrets.GIT_PAGE_DEPLOY }} | |
BRANCH: master # The branch the action should deploy to. | |
FOLDER: _site # The folder the action should deploy. | |
REPOSITORY_NAME: mydatahack/mydatahack.github.io | |
TARGET_FOLDER: portfolio | |
CLEAN: true # Automatically remove deleted files from the deploy branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment