Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 84571ed

Browse files
committedApr 10, 2020
deploy to netlify
1 parent 40bd247 commit 84571ed

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
 

‎.github/workflows/cron.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Hourly Build & Deploy to Netlify"
2+
on:
3+
schedule:
4+
- cron: '0 * * * *'
5+
jobs:
6+
build-and-deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checking out the repository
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Installing Nix
14+
uses: cachix/install-nix-action@v8
15+
- name: Building search.nixos.org
16+
run: nix-shell --run "yarn prod"
17+
- name: Deploy to Netlify
18+
uses: nwtgck/actions-netlify@v1.0.5
19+
env:
20+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
21+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
22+
with:
23+
publish-dir: './build'
24+
production-branch: 'master'
25+
deploy-message: 'Deploy from GitHub Actions'
26+
if: github.repository == 'NixOS/nixos-search'
27+

‎.github/workflows/main.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Build & Deploy to Netlify"
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checking out the repository
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Installing Nix
16+
uses: cachix/install-nix-action@v8
17+
- name: Building search.nixos.org
18+
run: nix-shell --run "yarn prod"
19+
- name: Deploy to Netlify
20+
uses: nwtgck/actions-netlify@v1.0.5
21+
env:
22+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
23+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
24+
with:
25+
publish-dir: './dist'
26+
production-branch: 'master'
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
deploy-message: 'Deploy from GitHub Actions'
29+
if: github.repository == 'NixOS/nixos-search'

0 commit comments

Comments
 (0)
Please sign in to comment.