chore: make build workflow work on GitHub Actions #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build | |
on: | |
pull_request: | |
branches: | |
- master | |
- production | |
push: | |
branches: | |
- master | |
- production | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: Build and generate artifact | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Docker images | |
run: | | |
docker compose build | |
# This step should probably be rewritten | |
- name: Run unit tests | |
run: | | |
docker run \ | |
--rm -ti \ | |
-v $(pwd):/app:delegated \ | |
-v /app/node_modules \ | |
sce_webpack:latest \ | |
/bin/bash -c "npx webpack --config webpack.dev.js && npm run test" | |
# TODO: Uncomment this step when ready. | |
# - name: Generate | |
# run: | | |
# mkdir artifacts | |
# docker run \ | |
# --rm \ | |
# -v $(pwd)/artifacts:/app/artifacts:delegated \ | |
# sce_webpack:latest \ | |
# /bin/bash -c "npm run build && cd dist && zip -r ../artifacts/screenly-chrome-extension.zip *" |