From 4347aa9720f9edbc8266744eb05a729740ff7c30 Mon Sep 17 00:00:00 2001 From: Emily Wangler Date: Sat, 18 Nov 2023 17:34:33 +0100 Subject: [PATCH] fix build & deploy --- .github/workflows/deploy.yml | 32 +++++++++++--------------------- .github/workflows/pr-open.yml | 23 ----------------------- package.json | 1 - 3 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/pr-open.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1e029c4..297d547 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,8 @@ on: branches: [ main ] # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] # Allow this job to clone the repo and create a page deployment permissions: @@ -20,35 +22,23 @@ jobs: steps: - name: Checkout your repository using git uses: actions/checkout@v3 + env: + NEXT_PUBLIC_TINA_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }} + TINA_TOKEN: ${{ secrets.TINA_TOKEN }} + NEXT_PUBLIC_TINA_BRANCH: main - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 18 - cache: 'yarn' + node-version: 20 + cache: 'npm' - name: Install and build astro shell: 'bash' run: | - yarn - yarn build - # - name: Install, build, and upload your site - # uses: withastro/action@v0 - # with: - # path: . # The root location of your Astro project inside the repository. (optional) - # node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional) - # package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) - - name: Install TinaCMS - working-directory: backend - run: npm ci - - name: Build TinaCMS - working-directory: backend - env: - NEXT_PUBLIC_TINA_CLIENT_ID: ${{ secrets.TINA_PUBLIC_CLIENT_ID }} - TINA_TOKEN: ${{ secrets.TINA_TOKEN }} - NEXT_PUBLIC_TINA_BRANCH: main - run: npx tinacms build + npm install + npm run build - name: Copy TinaCMS artifacts run: | - cp -R ./backend/public/it-landscape/admin/ ./dist/ + cp -R ./public/it-landscape/admin/ ./dist/ rm ./dist/admin/.gitignore - name: Create Pages Artifact uses: actions/upload-pages-artifact@v1 diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml deleted file mode 100644 index eddc7c7..0000000 --- a/.github/workflows/pr-open.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build Pull request -on: - pull_request: - types: [opened, synchronize, reopened] -env: - NEXT_PUBLIC_TINA_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_TINA_CLIENT_ID }} - TINA_TOKEN: ${{ secrets.TINA_TOKEN }} - NEXT_PUBLIC_TINA_BRANCH: ${{ github.head_ref }} -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node: ["14", "16", "17"] - name: Node ${{ matrix.node }} sample - steps: - - uses: actions/checkout@v3 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - run: yarn install - - run: yarn build diff --git a/package.json b/package.json index 8d618b6..2fcde2c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "private": true, "scripts": { "dev": "tinacms dev -c \"next dev & astro dev\"", - "tina": "tinacms dev -c \"next dev & astro dev\"", "build": "tinacms build && next build", "start": "tinacms build && next start", "lint": "next lint"