From e8f0c9d28bc83944625ed73b0b27f04bf056ecb0 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sat, 8 Feb 2025 00:41:04 +0000 Subject: [PATCH] chore: Add netlify preview build via github actions. --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/pages.yml | 6 +++--- .github/workflows/release.yml | 8 ++++++++ Dockerfile | 5 +++-- netlify.toml | 3 --- 5 files changed, 19 insertions(+), 13 deletions(-) delete mode 100644 netlify.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f954bec..517dbda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,11 +25,11 @@ jobs: with: tags: toxchat/toktok.github.io:latest outputs: type=docker - - name: Extract toktok-site directory from docker image - run: docker run --rm --entrypoint tar toxchat/toktok.github.io:latest -C /home/builder/build -c toktok-site | tar -x - - name: Upload toktok-site to artifacts + - name: Extract _site directory from docker image + run: docker run --rm --entrypoint tar toxchat/toktok.github.io:latest -C /home/builder/build -c _site | tar -x + - name: Upload _site to artifacts uses: actions/upload-artifact@v4 with: - name: toktok-site - path: toktok-site + name: _site + path: _site if-no-files-found: error diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 914ded1..c872406 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -33,14 +33,14 @@ jobs: with: tags: toxchat/toktok.github.io:latest outputs: type=docker - - name: Extract toktok-site directory from docker image - run: docker run --rm --entrypoint tar toxchat/toktok.github.io:latest -C /home/builder/build -c toktok-site | tar -x + - name: Extract _site directory from docker image + run: docker run --rm --entrypoint tar toxchat/toktok.github.io:latest -C /home/builder/build -c _site | tar -x - name: Set-up Pages uses: actions/configure-pages@v5 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: toktok-site + path: _site - name: Deploy GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fabdee..6f0854a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,3 +15,11 @@ concurrency: jobs: release: uses: TokTok/ci-tools/.github/workflows/release-drafter.yml@master + + netlify: + uses: TokTok/ci-tools/.github/workflows/netlify.yml@master + with: + dockerfile: Dockerfile + path: /home/builder/build + secrets: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 1db5201..f722490 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,8 @@ RUN ["make", "toktok-site"] COPY .md-style.rb /home/builder/build/ RUN ["make", "lint"] RUN . /path/to/venv/bin/activate \ - && make check + && make check \ + && mv toktok-site _site -WORKDIR /home/builder/build/toktok-site +WORKDIR /home/builder/build/_site ENTRYPOINT ["/home/builder/entrypoint.sh"] diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index b4869f6..0000000 --- a/netlify.toml +++ /dev/null @@ -1,3 +0,0 @@ -[build] -command = "gem install --no-document jekyll:4.2.2 guard-livereload sass-embedded:1.6.2 && make hs-toxcore && make toktok-site" -publish = "toktok-site"