From 618e9e5268929a763bfabcafdfa42cb488294c2d Mon Sep 17 00:00:00 2001 From: Robert Lanzafame Date: Sun, 13 Oct 2024 14:39:58 +0200 Subject: [PATCH] try --- .github/workflows/build-website.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/pelican.yml | 14 ---------- 2 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/build-website.yml delete mode 100644 .github/workflows/pelican.yml diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml new file mode 100644 index 0000000..48ae55d --- /dev/null +++ b/.github/workflows/build-website.yml @@ -0,0 +1,41 @@ +name: Build Website + +on: + push: + branches: main + pull_request: + branches: main + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + python-version: [3.13] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pelican pyyaml beautifulsoup4 ghp-import + git clone --depth=1 --single-branch --branch main https://github.com/rlanzafame/pelican-alchemy.git + git clone --depth=1 https://github.com/getpelican/pelican-plugins.git + - name: Build the website + run: | + pelican -D -v --fatal errors -s publishconf.py -o output + - name: Deploy the website + if: ${{ github.event_name == 'push' }} + run: | + git fetch origin + git checkout deploy + git pull origin deploy + git config --global user.name "Github Actions" + git config --global user.email rlanzafame@users.noreply.github.com + git remote add deploy "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/rlanzafame/rlanzafame.github.io.git" + ghp-import -r deploy -b main -m "Updated via Github Actions [skip ci]" -p output \ No newline at end of file diff --git a/.github/workflows/pelican.yml b/.github/workflows/pelican.yml deleted file mode 100644 index 9a7082a..0000000 --- a/.github/workflows/pelican.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Deploy to GitHub Pages -on: - push: - branches: ["main"] - workflow_dispatch: -jobs: - deploy: - uses: "getpelican/pelican/.github/workflows/github_pages.yml@main" - permissions: - contents: "read" - pages: "write" - id-token: "write" - with: - settings: "publishconf.py" \ No newline at end of file