chore: remove unwanted internal git repo during dev env setup #359
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: Publish site | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
cache: | |
description: "Don't use jekyll cache" | |
required: false | |
type: boolean | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Checkout theme-files repo | |
uses: actions/checkout@v3 | |
with: | |
repository: genicsblog/theme-files | |
path: theme | |
fetch-depth: 1 | |
- name: Setup theme and necessary files | |
run: | | |
mv theme/* . | |
rm -rf theme | |
rm robots.txt | |
touch .nojekyll | |
echo "google.com, pub-8114751086331659, DIRECT, f08c47fec0942fa0" >> ads.txt | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
files: | |
- '_data/**' | |
- '_drafts/**' | |
- '_pages/**' | |
- '_posts/**' | |
- '_series/**' | |
- '_tools/**' | |
- '_config.yml' | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7.5 | |
bundler-cache: true | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install npm dependencies | |
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch' | |
run: npm install | |
- name: Restore/cache .jekyll-cache folder | |
if: github.event_name == 'push' || inputs.cache == 'false' | |
id: jekyll-cache | |
uses: actions/cache@v3 | |
with: | |
path: .jekyll-cache | |
key: ${{ runner.os }}-${{ hashFiles('Gemfile') }} | |
- name: Build production jekyll site | |
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch' | |
run: JEKYLL_ENV=production NODE_ENV=production bundle exec jekyll build | |
env: | |
BEYONDWORDS_API_KEY: ${{ secrets.BEYONDWORDS_API_KEY }} | |
BEYONDWORDS_PROJECT_ID: ${{ secrets.BEYONDWORDS_PROJECT_ID }} | |
- name: Deploy to gh-pages | |
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _site | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |