Merge pull request #242 from mismith0227/develop #21
This file contains 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: create new branch | |
on: | |
push: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout master | |
uses: actions/checkout@v2 | |
with: | |
ref: master | |
- name: npm init | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '12.x' | |
- name: Create new Branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
yarn | |
yarn build | |
rm -rf .git | |
git init | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI Action" | |
if [[ ! -f .gitignore ]]; then | |
# Make sure .gitignore exists | |
touch .gitignore | |
fi | |
if ! grep -q .gitignore; then | |
echo "src | |
.editorconfig | |
.gitignore | |
.babelrc | |
.github/ | |
./images | |
webpack.config.js | |
bin | |
gulpfile.js | |
.prettierignore | |
.prettierrc | |
config.js | |
node_modules | |
content | |
package.json | |
svgpack | |
tmp | |
config.toml | |
yarn.lock | |
renovate.json | |
!/exampleSite/config.toml | |
!/exampleSite/content | |
!/exampleSite/static" >> .gitignore | |
fi | |
git add . | |
git commit -m "Deploy from Github Actions" | |
git push --force --quiet "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" master:release |