From 0d510171ba208db8e09bc013d27cf065be3d694d Mon Sep 17 00:00:00 2001 From: AgataBialoskorska Date: Thu, 14 Mar 2024 18:02:35 +0100 Subject: [PATCH] rewrite yml to adjust files copying to dist --- .github/workflows/build-and-deploy.yml | 68 ++++++++++++++++++++------ 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 9f26136..4adde95 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -1,28 +1,66 @@ -name: Node.js CI +# name: Node.js CI +# on: +# push: +# branches: [ master ] +# jobs: +# build: +# runs-on: ubuntu-latest +# steps: +# # https://github.com/actions/checkout +# - uses: actions/checkout@v3 +# # a standard step for GitHub actions on Node +# # https://github.com/actions/setup-node +# - uses: actions/setup-node@v3 +# with: +# # update the Node version to meet your needs +# node-version: 21 +# cache: npm +# - name: Build +# run: | +# npm ci +# npm install +# npm run build +# - name: Deploy +# # https://github.com/JamesIves/github-pages-deploy-action +# uses: JamesIves/github-pages-deploy-action@v4.4.1 +# with: +# branch: gh-pages +# folder: dist + + +name: Build and Deploy + on: push: - branches: [ master ] + branches: + - master + jobs: build: runs-on: ubuntu-latest + steps: - # https://github.com/actions/checkout - - uses: actions/checkout@v3 - # a standard step for GitHub actions on Node - # https://github.com/actions/setup-node - - uses: actions/setup-node@v3 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 with: - # update the Node version to meet your needs - node-version: 21 - cache: npm + node-version: '21' + cache: 'npm' + + - name: Install dependencies + run: npm ci + - name: Build - run: | - npm ci - npm install - npm run build + run: npm run build + + - name: Copy assets + run: cp -R src/components/img dist/img + - name: Deploy # https://github.com/JamesIves/github-pages-deploy-action uses: JamesIves/github-pages-deploy-action@v4.4.1 with: branch: gh-pages - folder: dist \ No newline at end of file + folder: dist