Skip to content

Merge pull request #14 from OpenShock/dependabot/npm_and_yarn/npm-dep… #39

Merge pull request #14 from OpenShock/dependabot/npm_and_yarn/npm-dep…

Merge pull request #14 from OpenShock/dependabot/npm_and_yarn/npm-dep… #39

Workflow file for this run

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
types: [opened, reopened, synchronize]
workflow_dispatch:
name: ci-build
env:
ARTIFACT_NAME: openshock-landingpage.zip
NODE_ENV: production
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
~/.npm
~/node_modules
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install dependencies
run: npm install --production=false
# ^
# This is necessary since NODE_ENV=production, but we need dev dependencies to build.
- name: Build
run: npm run build --if-present
- name: Compress internal artifacts
run: |
cd dist
zip -r ${{ env.ARTIFACT_NAME }} .
cd ..
mv dist/${{ env.ARTIFACT_NAME }} .
- name: Upload internal artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ github.workspace }}/${{ env.ARTIFACT_NAME }}
retention-days: 1