From 67167e7bcc5d7a4c78306ff0f9a5a778735726ba Mon Sep 17 00:00:00 2001 From: Samuel Oosterholt Date: Wed, 18 Sep 2024 14:35:37 +0200 Subject: [PATCH] ci: add build workflow --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 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..0908999 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint-and-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Yarn + run: yarn install + + - name: Lint code + run: yarn lint + + - name: Build code + run: yarn build + + docker-build: + runs-on: ubuntu-latest + needs: lint-and-build + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Docker image + run: | + docker build -t your-project-name:latest .