diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..06bf452 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: "Build and deploy to Netlify" +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v17 + with: + nix_path: nixpkgs=channel:nixpkgs-unstable + - run: nix develop -c make build + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v1.2 + with: + publish-dir: ./public + netlify-config-path: ./netlify.toml + production-branch: master + production-deploy: ${{ github.ref_name == 'master' }} + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: "Deploy from GitHub Actions" + enable-pull-request-comment: true + enable-commit-comment: true + enable-commit-status: true + overwrites-pull-request-comment: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_ACCESS_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff --git a/.github/workflows/update-webring.yml b/.github/workflows/update-webring.yml deleted file mode 100644 index 7106d26..0000000 --- a/.github/workflows/update-webring.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: "Update webring post list" -on: - schedule: - # Every Sunday. - - cron: '0 0 * * 0' -env: - # GitHub bot - GIT_AUTHOR_NAME: "github-actions[bot]" - GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com" -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v18 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - keep-going = true - - run: nix develop -c make build-openring - - name: Update webring post list - run: | - git add . - git commit -m "Update webring post list as of $(date '+%F')" - git remote remove origin - git remote add origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git - git push --set-upstream origin master diff --git a/netlify.toml b/netlify.toml index 14af1e9..03a2586 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,29 +1,15 @@ [build] publish = "public/" -command = "gem install bundler -v '~> 2.3' && bundle && hugo --gc --minify" - -[context.production] -command = "gem install bundler -v '~> 2.3' && bundle && hugo --gc --minify --baseURL $URL" +command = "make build" [context.production.environment] -RUBY_VERSION = "3.0.4" -HUGO_VERSION = "0.107.0" -HUGO_ENV = "production" -HUGO_ENABLEGITINFO = "true" - -[context.branch-deploy] -command = "gem install bundler -v '~> 2.3' && bundle && hugo --buildDrafts --buildFuture --buildExpired --baseURL $DEPLOY_PRIME_URL" +HUGO_BASE_URL = "$DEPLOY_URL" [context.branch-deploy.environment] -RUBY_VERSION = "3.0.4" -HUGO_VERSION = "0.107.0" -HUGO_ENV = "development" +HUGO_BASE_URL = "$DEPLOY_PRIME_URL" [context.deploy-preview] -command = "gem install bundler -v '~> 2.3' && bundle && hugo --buildDrafts --buildFuture --buildExpired --baseURL $DEPLOY_PRIME_URL" +command = "hugo --buildDrafts --buildFuture --buildExpired" [context.deploy-preview.environment] -RUBY_VERSION = "3.0.4" -HUGO_ENV = "development" -HUGO_VERSION = "0.107.0" - +HUGO_BASE_URL = "$DEPLOY_PRIME_URL"