From ee17be9d065f66dd8b1973d5cd3552e24d1a2f6f Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Mon, 7 Oct 2024 18:39:15 +0500 Subject: [PATCH] Add workflow --- .github/workflows/vite_deploy.yaml | 44 ------------------------------ .woodpecker.yaml | 19 +++++++++++++ README.md | 2 +- vite.config.js | 2 +- 4 files changed, 21 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/vite_deploy.yaml create mode 100644 .woodpecker.yaml diff --git a/.github/workflows/vite_deploy.yaml b/.github/workflows/vite_deploy.yaml deleted file mode 100644 index 35d1f0f..0000000 --- a/.github/workflows/vite_deploy.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Deploy static content to Pages - -on: - push: - branches: ["main"] - - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "npm" - - name: Install dependencies - run: npm install - - name: Build - run: npm run build - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: "./dist" - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..a526c95 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,19 @@ +steps: + - name: deploy + image: node:current-alpine + commands: + - apk add --no-cache zip curl + - rm package-lock.json + - npm install + - npm run build + - (cd dist && zip -r ../project.zip ./*) + + - 'AUTH_HEADER="Authorization: Bearer $PAGES_API_KEY"' + - API_URL=https://pages.hadeedahmad.com/pages/$(basename "$PWD") + - curl -s -w "%{http_code}" -F "zipfile=@project.zip" -H "$AUTH_HEADER" "$API_URL" | grep -q 200 + + secrets: [ PAGES_API_KEY ] + when: + - event: manual + - event: push + branch: main diff --git a/README.md b/README.md index 34240e4..a919be2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Frontend Mentor - Recipe page solution -This is a solution to the [Recipe page challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/recipe-page-KiTsR8QQKm). Frontend Mentor challenges help you improve your coding skills by building realistic projects. +This is a solution to the [Recipe page challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/recipe-page-KiTsR8QQKm). diff --git a/vite.config.js b/vite.config.js index 18fef73..e0d6078 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,5 @@ import { defineConfig } from "vite"; export default defineConfig({ - base: "/fem-recipe-page/", + base: "/recipe-page/", });