From f6dfb72cdcf98917c9e076e2804a20eccd71ee6b Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 11 Dec 2024 21:24:37 +0100 Subject: [PATCH] Basic GitHub Actions workflow --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..04c5ac2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Test and Build the Application +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.11.1" + - name: Install dependencies + run: npm install + - name: Run tests + run: npm test + build: + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout the code + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.11.1" + - name: Install dependencies + run: npm install + - name: Build the application + run: npm run build + - name: Upload artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: dist-files + path: dist