chore: make build workflow work on GitHub Actions #9
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 | |
- name: Run unit tests | |
run: | | |
docker run \ | |
--rm \ | |
-v $(pwd):/app:delegated \ | |
-v /app/node_modules \ | |
sce_webpack:latest \ | |
/bin/bash -c "npx webpack --config webpack.dev.js && npm run test" | |
- name: Build and package the extension | |
run: | | |
mkdir artifacts | |
docker run \ | |
--rm \ | |
-v $(pwd)/artifacts:/app/artifacts:delegated \ | |
-v /app/artifacts/node_modules \ | |
sce_webpack:latest \ | |
/bin/bash -c "npm run build && cd dist && zip -r ../artifacts/screenly-chrome-extension.zip *" | |
- name: Upload archive as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: screenly-chrome-extension | |
path: artifacts/screenly-chrome-extension.zip |