Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix dev docker image #584

Merged
merged 9 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/dev-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ jobs:
if: github.event_name == 'pull_request'
- run: make build
- run: docker images
- run: make ci
- run: make all
- run: docker-compose push
if: github.ref == 'refs/heads/main' && github.event.repository.fork == false
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
npm --version
git --version

- run: npm ci
- run: npm ci --ignore-scripts

- name: npm audit
if: startsWith(matrix.os, 'ubuntu-18.04')
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ RUN apt-get update && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

RUN git --version && \
git config --global init.defaultBranch main && \
git config --global init.defaultBranch

WORKDIR /node
ARG NODE_VERSION
RUN curl -o nodejs.deb "https://deb.nodesource.com/node_${NODE_VERSION%%.*}.x/pool/main/n/nodejs/nodejs_${NODE_VERSION}-1nodesource1_amd64.deb" && \
apt-get update && \
apt-get install -y --no-install-recommends ./nodejs.deb && \
npm config set user 0 && \
npm config set unsafe-perm true && \
npm i -g npm && \
curl -sL https://deb.nodesource.com/test | bash - && \
npm cache clean --force && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /node

Expand All @@ -46,10 +53,4 @@ ENV RUNNER_USER="runner"
ENV RUNNER_TEMP="/home/runner/work/_temp"
ENV RUNNER_WORKSPACE="/home/runner/work/pages"

RUN echo "node version: $(node -v)" && \
echo "npm version: $(npm -v)" && \
git --version && \
git config --global init.defaultBranch main && \
git config --global init.defaultBranch

CMD [ "bash" ]
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,3 @@ build:
.PHONY: run
run:
docker-compose run --rm dev bash

.PHONY: ci
ci:
docker-compose run --rm -T dev npm ci --unsafe-perm=true --allow-root

.PHONY: test
test:
docker-compose run --rm -T dev npm test

.PHONY: all
all:
docker-compose run --rm -T dev npm run all