From 824e37026f4f4a7e2baecf201e04dd549bdf4b56 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Fri, 10 Apr 2020 11:04:03 +0200 Subject: [PATCH] deploy to netlify (#1) --- .github/workflows/cron.yml | 27 +++++++++++++++++++++++++++ .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ src/Main.elm | 10 ++++++++-- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cron.yml create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml new file mode 100644 index 0000000..80926d5 --- /dev/null +++ b/.github/workflows/cron.yml @@ -0,0 +1,27 @@ +name: "Hourly Build & Deploy to Netlify" +on: + schedule: + - cron: '0 * * * *' +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checking out the repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Installing Nix + uses: cachix/install-nix-action@v8 + - name: Building search.nixos.org + run: nix-shell --run "yarn prod" + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v1.0.5 + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + with: + publish-dir: './build' + production-branch: 'master' + deploy-message: 'Deploy from GitHub Actions' + if: github.repository == 'NixOS/nixos-search' + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e4c34d0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: "Build & Deploy to Netlify" +on: + pull_request: + push: + branches: + - master +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checking out the repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Installing Nix + uses: cachix/install-nix-action@v8 + - name: Building search.nixos.org + run: nix-shell --run "yarn prod" + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v1.0.5 + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + with: + publish-dir: './dist' + production-branch: 'master' + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: 'Deploy from GitHub Actions' + if: github.repository == 'NixOS/nixos-search' diff --git a/src/Main.elm b/src/Main.elm index db6eec6..27bc86c 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -532,7 +532,11 @@ searchPage model = searchPageResult model.showDetailsFor result.hits R.Failure error -> - div [] [ text "Error!", pre [] [ text (Debug.toString error) ] ] + div [] + [ text "Error!" + + --, pre [] [ text (Debug.toString error) ] + ] ] @@ -560,7 +564,9 @@ searchPageResultItem showDetailsFor item = let packageDetails = if Just item.id == showDetailsFor then - [ td [ colspan 4 ] [ text "works!" ] ] + [ td [ colspan 4 ] + [] + ] else []