Created
August 1, 2021 17:22
-
-
Save BlakeRain/cae8edfa273d7603d25e5527c6821984 to your computer and use it in GitHub Desktop.
Workflow to build and deploy the static blakerain.com
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: Build | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [deploy-event] | |
jobs: | |
deploy: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
with: | |
repository: BlakeRain/blakerain.com | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "16" | |
- name: Install yarn | |
run: | | |
npm install -g yarn | |
- name: Install dependencies | |
run: yarn install | |
- name: Build the static site | |
env: | |
GHOST_HOSTNAME: ${{ secrets.GHOST_HOSTNAME }} | |
GHOST_CONTENT_API_KEY: ${{ secrets.GHOST_CONTENT_API_KEY }} | |
run: yarn build | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
- name: Install requirements | |
run: | | |
pip3 install -r search/requirements.txt | |
- name: Build the search data | |
env: | |
DOMAIN: ${{ secrets.GHOST_HOSTNAME }} | |
API_KEY: ${{ secrets.GHOST_CONTENT_API_KEY }} | |
run: | | |
mkdir -p dist/data | |
python3 search/update-search.py | |
- name: Upload the static site to Netlify | |
run: | | |
npx netlify-cli deploy --auth=${{ secrets.NETLIFY_AUTH }} --dir=dist --site=${{ secrets.NETLIFY_SITE_API_ID }} --prod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment