Skip to content

Merge pull request #202 from levelupcc/gh-pages #7

Merge pull request #202 from levelupcc/gh-pages

Merge pull request #202 from levelupcc/gh-pages #7

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy dev site
on:
# Runs on pushes targeting the default branch
push:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# permissions:
# contents: read
# pages: write
# id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '2.5' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
# Outputs to the './_site' directory by default
# Clarify the right site url for each branch using config chain includes
run: bundle exec jekyll build --config _config.yml,_config_dev.yml
env:
JEKYLL_ENV: production
- name: Set CNAME
# set cname for gh pages, should match config file site.url variable above
run: echo "dev.level-up.cc" > ./_site/CNAME
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v2
- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.DEV_DEPLOY_KEY }}
# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: './_site'
# target-directory: '.' per https://cpina.github.io/push-to-another-repository-docs/faq.html#how-can-i-copy-the-whole-repository
destination-github-username: 'levelupcc'
destination-repository-name: 'level-up-dev'
user-name: 'Level Up Bot'
user-email: [email protected]
target-branch: main