mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-14 14:16:00 +08:00
feat: bump node12 to node16 (#791)
* feat: bump node12 to node16 * deps: bump node from 12.22.10 to 16.18.0 * deps: bump @actions/core from 1.6.0 to 1.10.0 * chore: remove dev docker image, Makefile * docs: replace set-output with GITHUB_OUTPUT * docs: bump actions/cache from v2 to v3
This commit is contained in:
parent
2bef62f818
commit
44a2b4403c
38
.github/workflows/dev-image.yml
vendored
38
.github/workflows/dev-image.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
name: 'Dev Image CI'
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '11 11 * * *'
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/dev-image.yml'
|
|
||||||
- '.dockerignore'
|
|
||||||
- '.nvmrc'
|
|
||||||
- 'Dockerfile'
|
|
||||||
- 'Makefile'
|
|
||||||
- 'docker-compose.yml'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/dev-image.yml'
|
|
||||||
- '.dockerignore'
|
|
||||||
- '.nvmrc'
|
|
||||||
- 'Dockerfile'
|
|
||||||
- 'Makefile'
|
|
||||||
- 'docker-compose.yml'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
dev-image-test:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Login to Packages
|
|
||||||
run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login 'docker.pkg.github.com' -u 'peaceiris' --password-stdin
|
|
||||||
- run: docker-compose pull --quiet
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
- run: make build
|
|
||||||
- run: docker images
|
|
||||||
- run: docker-compose push
|
|
||||||
if: ${{ github.ref == 'refs/heads/main' && github.event.repository.fork == false }}
|
|
56
Dockerfile
56
Dockerfile
@ -1,56 +0,0 @@
|
|||||||
FROM ubuntu:18.04
|
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-l", "-c"]
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y --no-install-recommends software-properties-common gnupg && \
|
|
||||||
add-apt-repository ppa:git-core/ppa && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
ssh \
|
|
||||||
vim && \
|
|
||||||
apt-get autoclean && \
|
|
||||||
apt-get clean && \
|
|
||||||
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
|
|
||||||
|
|
||||||
WORKDIR /repo
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND="noninteractive"
|
|
||||||
ENV LANG="C.UTF-8"
|
|
||||||
ENV CI="true"
|
|
||||||
ENV ImageVersion="20200717.1"
|
|
||||||
ENV GITHUB_SERVER_URL="https://github.com"
|
|
||||||
ENV GITHUB_API_URL="https://api.github.com"
|
|
||||||
ENV GITHUB_GRAPHQL_URL="https://api.github.com/graphql"
|
|
||||||
ENV GITHUB_REPOSITORY_OWNER="peaceiris"
|
|
||||||
ENV GITHUB_ACTIONS="true"
|
|
||||||
ENV GITHUB_ACTOR="peaceiris"
|
|
||||||
ENV GITHUB_REPOSITORY="actions/pages"
|
|
||||||
ENV RUNNER_OS="Linux"
|
|
||||||
ENV RUNNER_TOOL_CACHE="/opt/hostedtoolcache"
|
|
||||||
ENV RUNNER_USER="runner"
|
|
||||||
ENV RUNNER_TEMP="/home/runner/work/_temp"
|
|
||||||
ENV RUNNER_WORKSPACE="/home/runner/work/pages"
|
|
||||||
|
|
||||||
CMD [ "bash" ]
|
|
10
Makefile
10
Makefile
@ -1,10 +0,0 @@
|
|||||||
IMAGE_NAME := docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest
|
|
||||||
NODE_VERSION := $(shell cat ./.nvmrc)
|
|
||||||
|
|
||||||
.PHONY: build
|
|
||||||
build:
|
|
||||||
docker-compose build --build-arg NODE_VERSION=$(NODE_VERSION)
|
|
||||||
|
|
||||||
.PHONY: run
|
|
||||||
run:
|
|
||||||
docker-compose run --rm dev bash
|
|
30
README.md
30
README.md
@ -504,17 +504,15 @@ jobs:
|
|||||||
id: prepare_tag
|
id: prepare_tag
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
TAG_NAME="${GITHUB_REF##refs/tags/}"
|
echo "DEPLOY_TAG_NAME=deploy-${TAG_NAME}" >> "${GITHUB_OUTPUT}"
|
||||||
echo "::set-output name=tag_name::${TAG_NAME}"
|
|
||||||
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}"
|
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./public
|
publish_dir: ./public
|
||||||
tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
|
tag_name: ${{ steps.prepare_tag.outputs.DEPLOY_TAG_NAME }}
|
||||||
tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
|
tag_message: 'Deployment ${{ github.ref_name }}'
|
||||||
```
|
```
|
||||||
|
|
||||||
Commands on a local machine.
|
Commands on a local machine.
|
||||||
@ -698,7 +696,7 @@ jobs:
|
|||||||
node-version: '14'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
@ -748,7 +746,7 @@ jobs:
|
|||||||
node-version: '14'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
@ -801,12 +799,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Get yarn cache
|
- name: Get yarn cache
|
||||||
id: yarn-cache
|
id: yarn-cache
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
@ -857,7 +855,7 @@ jobs:
|
|||||||
node-version: '14'
|
node-version: '14'
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
@ -916,12 +914,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Get yarn cache
|
- name: Get yarn cache
|
||||||
id: yarn-cache
|
id: yarn-cache
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
|
||||||
key: ${{ runner.os }}-website-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-website-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-website-
|
${{ runner.os }}-website-
|
||||||
@ -981,7 +979,7 @@ jobs:
|
|||||||
run: echo "::set-output name=dir::$(pip cache dir)"
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ${{ steps.pip-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
@ -1168,7 +1166,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/Publish_build
|
~/Publish_build
|
||||||
|
@ -2,7 +2,7 @@ name: 'GitHub Pages action'
|
|||||||
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
description: 'GitHub Actions for GitHub Pages 🚀 Deploy static files and publish your site easily. Static-Site-Generators-friendly.'
|
||||||
author: 'peaceiris'
|
author: 'peaceiris'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'lib/index.js'
|
main: 'lib/index.js'
|
||||||
branding:
|
branding:
|
||||||
icon: 'upload-cloud'
|
icon: 'upload-cloud'
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
version: '3.2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
dev:
|
|
||||||
image: 'docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest'
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
cache_from:
|
|
||||||
- 'docker.pkg.github.com/peaceiris/actions-gh-pages/dev:latest'
|
|
||||||
container_name: peaceiris_actions_github_pages
|
|
||||||
volumes:
|
|
||||||
- ${PWD}:/repo
|
|
||||||
stdin_open: true
|
|
||||||
tty: true
|
|
||||||
command:
|
|
||||||
- bash
|
|
58
package-lock.json
generated
58
package-lock.json
generated
@ -10,7 +10,7 @@
|
|||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^5.0.1",
|
"@actions/github": "^5.0.1",
|
||||||
"@actions/glob": "^0.2.1",
|
"@actions/glob": "^0.2.1",
|
||||||
@ -40,16 +40,25 @@
|
|||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.20.1",
|
"node": ">=16.18.0",
|
||||||
"npm": ">=7.5.2"
|
"npm": ">=8.19.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.6.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||||
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@actions/core/node_modules/@actions/http-client": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
|
"dependencies": {
|
||||||
|
"tunnel": "^0.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/exec": {
|
"node_modules/@actions/exec": {
|
||||||
@ -9369,11 +9378,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/uuid": {
|
"node_modules/uuid": {
|
||||||
"version": "8.3.1",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"uuid": "dist/bin/uuid"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
@ -9715,11 +9722,22 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.6.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
|
||||||
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
|
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/http-client": "^1.0.11"
|
"@actions/http-client": "^2.0.1",
|
||||||
|
"uuid": "^8.3.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/http-client": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
|
||||||
|
"requires": {
|
||||||
|
"tunnel": "^0.0.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@actions/exec": {
|
"@actions/exec": {
|
||||||
@ -17210,11 +17228,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "8.3.1",
|
"version": "8.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
"dev": true,
|
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"v8-compile-cache": {
|
"v8-compile-cache": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
"description": "GitHub Actions for GitHub Pages",
|
"description": "GitHub Actions for GitHub Pages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.20.1",
|
"node": ">=16.18.0",
|
||||||
"npm": ">=7.5.2"
|
"npm": ">=8.19.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "npx husky install",
|
"postinstall": "npx husky install",
|
||||||
@ -47,7 +47,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/peaceiris/actions-gh-pages#readme",
|
"homepage": "https://github.com/peaceiris/actions-gh-pages#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^5.0.1",
|
"@actions/github": "^5.0.1",
|
||||||
"@actions/glob": "^0.2.1",
|
"@actions/glob": "^0.2.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user