mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 22:29:17 +08:00
build: fix dev docker image (#584)
This commit is contained in:
parent
65a821ebc7
commit
b52df3c817
2
.github/workflows/dev-image.yml
vendored
2
.github/workflows/dev-image.yml
vendored
@ -34,7 +34,5 @@ jobs:
|
|||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
- run: make build
|
- run: make build
|
||||||
- run: docker images
|
- run: docker images
|
||||||
- run: make ci
|
|
||||||
- run: make all
|
|
||||||
- run: docker-compose push
|
- run: docker-compose push
|
||||||
if: github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
if: github.ref == 'refs/heads/main' && github.event.repository.fork == false
|
||||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -46,7 +46,7 @@ jobs:
|
|||||||
npm --version
|
npm --version
|
||||||
git --version
|
git --version
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci --ignore-scripts
|
||||||
|
|
||||||
- name: npm audit
|
- name: npm audit
|
||||||
if: startsWith(matrix.os, 'ubuntu-18.04')
|
if: startsWith(matrix.os, 'ubuntu-18.04')
|
||||||
|
13
Dockerfile
13
Dockerfile
@ -17,13 +17,20 @@ RUN apt-get update && \
|
|||||||
apt-get autoremove -y && \
|
apt-get autoremove -y && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN git --version && \
|
||||||
|
git config --global init.defaultBranch main && \
|
||||||
|
git config --global init.defaultBranch
|
||||||
|
|
||||||
WORKDIR /node
|
WORKDIR /node
|
||||||
ARG NODE_VERSION
|
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" && \
|
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 update && \
|
||||||
apt-get install -y --no-install-recommends ./nodejs.deb && \
|
apt-get install -y --no-install-recommends ./nodejs.deb && \
|
||||||
|
npm config set user 0 && \
|
||||||
|
npm config set unsafe-perm true && \
|
||||||
npm i -g npm && \
|
npm i -g npm && \
|
||||||
curl -sL https://deb.nodesource.com/test | bash - && \
|
curl -sL https://deb.nodesource.com/test | bash - && \
|
||||||
|
npm cache clean --force && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
rm -rf /node
|
rm -rf /node
|
||||||
|
|
||||||
@ -46,10 +53,4 @@ ENV RUNNER_USER="runner"
|
|||||||
ENV RUNNER_TEMP="/home/runner/work/_temp"
|
ENV RUNNER_TEMP="/home/runner/work/_temp"
|
||||||
ENV RUNNER_WORKSPACE="/home/runner/work/pages"
|
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" ]
|
CMD [ "bash" ]
|
||||||
|
12
Makefile
12
Makefile
@ -8,15 +8,3 @@ build:
|
|||||||
.PHONY: run
|
.PHONY: run
|
||||||
run:
|
run:
|
||||||
docker-compose run --rm dev bash
|
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user