diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml index 394c807..d87200b 100644 --- a/.gitea/workflows/demo.yaml +++ b/.gitea/workflows/demo.yaml @@ -1,6 +1,6 @@ name: Gitea Actions Demo run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] +on: [pull] jobs: Explore-Gitea-Actions: diff --git a/.gitea/workflows/quartz-build-publish.yaml b/.gitea/workflows/quartz-build-publish.yaml index 4515265..90cf690 100644 --- a/.gitea/workflows/quartz-build-publish.yaml +++ b/.gitea/workflows/quartz-build-publish.yaml @@ -1,19 +1,68 @@ name: Quartz Publisher -run-name: ${{ github.actor }} is testing out Gitea Actions 🚀 +run-name: Quartz Publisher for Obsidian on: [push] jobs: - Explore-Gitea-Actions: + Quartz-Build-Publish: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - name: Check out repository code uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository + + - name: Organize content run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + git checkout -b quartz + mkdir content && + find . -type d,f -maxdepth 1 -regextype posix-extended ! -regex '^\.$|\./(\.git|\.obsidian|\.trash|content).*' -exec mv {} content/ \; + + - name: Clone Quartz, move content + run: | + git clone https://github.com/jackyzha0/quartz.git + mv content/* quartz/content + + - name: Setup Node + uses: actions/setup-node@v6 + working-directory: quartz/ + with: + node-version: 24 + + - name: Cache dependencies + uses: actions/cache@v5 + working-directory: quartz/ + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Cache Quartz plugins + uses: actions/cache@v5 + working-directory: quartz/ + with: + path: .quartz/plugins + key: ${{ runner.os }}-plugins-${{ hashFiles('quartz.lock.json') }} + restore-keys: | + ${{ runner.os }}-plugins- + + - run: npm install && npm install wrangler + working-directory: quartz/ + + - name: Install Quartz plugins + run: npx quartz plugin install + working-directory: quartz/ + + - name: Quartz Create + run: npx quartz create --template ${{ vars.QUARTZ_CREATE_TEMPLATE }} --baseUrl ${{ vars.QUARTZ_CREATE_BASEURL }} + working-directory: quartz/ + + - name: Quartz Build + run: npx quartz build + working-directory: quartz/ + + - name: Wrangler deploy + workingDirectory: "quartz" + uses: cloudflare/wrangler-action@v4 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + command: pages deploy public --name=test1