尝试使用Github的beta操作时,我有两项工作,一项工作是构建代码,然后一项将部署代码。但是,我似乎无法在部署工作中获得构建工件。
我的最新尝试是为每个作业手动设置具有相同卷数的容器映像,根据文档,这应该是解决方案:https : //help.github.com/en/articles/workflow-syntax-for-github-actions# jobsjob_idcontainervolumes
设置供容器使用的卷阵列。您可以使用卷在服务或作业中的其他步骤之间共享数据。您可以指定命名的Docker卷,匿名Docker卷或在主机上绑定安装。
工作流程
name: CI
on:
push:
branches:
- master
paths:
- .github/workflows/server.yml
- server/*
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://node:10
volumes:
- /workspace:/github/workspace
steps:
- uses: actions/checkout@master
- run: yarn install
working-directory: server
- run: yarn build
working-directory: server
- run: yarn test
working-directory: server
- run: ls
working-directory: server
deploy:
needs: build
runs-on: ubuntu-latest
container:
image: docker://google/cloud-sdk:latest
volumes:
- /workspace:/github/workspace
steps:
- uses: actions/checkout@master
- run: ls
working-directory: server
- run: gcloud …Run Code Online (Sandbox Code Playgroud) 尝试从Moment.js迁移到Dayjs,但我唯一无法工作的是Timezone缩写。
dayjs('2020-07-06T14:30:00.000-04:00').tz(dayjs.tz.guess()).format('Do MMM YYYY [at] HH:MMa z')
Run Code Online (Sandbox Code Playgroud)
调用上面的内容是我所期望的6th Jul 2020 at 08:07am EDT,但目前我刚刚知道它z在哪里EDT。
我已经添加了utc和timezone插件,但看不到完成此工作所需的任何其他插件,我注意到未列出的Dayjs格式文档z,但在网上搜索时,我看到很多人说解决方案是,format('', {timeZone})但format没有不需要第二个论点吗?
看起来它已添加到tz-plugin:https://github.com/iamkun/dayjs/pull/325/files#diff-cad460a5e46a2a48c59e95356c683820R195
这是一个包含问题示例的代码沙箱: https ://codesandbox.io/s/hungry-knuth-r58gz
- - 编辑
看起来对tzabbr 的支持已被删除:(
https://github.com/iamkun/dayjs/pull/448/commits/e64c03cea79c579bcd3c4caf235b4724e56614d4
是否有任何网站显示来自Node Package Manger(NPM)的这周/月最受欢迎的模块.
我知道www.npmjs.com有packages people 'npm install' a lot,但很少更改.我也有一个谷歌这样的东西,但没有任何结果.
我想要一些我可以查看节点的新/趋势包的东西.
有没有办法列出所有别名,如:
$ ls-aliases
.. "cd .."
la "ls -Gla"
gs "git stash"
etc...
Run Code Online (Sandbox Code Playgroud)
也可以在别名中添加人类可读的描述吗?
我在MacOSX上
我可以更改 moment.js 中的时间范围吗fromNow(),因此小时范围是 60 秒到 59 分钟,其他人也不是(90 秒 - 45 分钟)。
是否有类似于如何更改 lang 的内容:
moment.lang('en', {
relativeTime: {
future: 'Due in %s',
past: '%s ago',
s: 'seconds',
m: 'a minute',
mm: '%d minutes',
h: 'an hour',
hh: '%d hours',
d: 'a day',
dd: '%d days',
M: 'a month',
MM: '%d months',
y: 'a year',
yy: '%d years',
},
});
Run Code Online (Sandbox Code Playgroud) 我在某些页面上遇到此错误,而不是全部,但无法将其跟踪到我的代码中的任何内容.
来自模拟器的红色错误模态:
this._easing is not a function. (In 'this._easing((now-this._startTime)/this.duration)', 'this._easing is NaN')
onUpdate
AnimatedImplementation.js @ 216:8
CallTimer
callTimers
__callFunction
<unknown>
guard
CallFunctionreturnFlusedQueue
Run Code Online (Sandbox Code Playgroud)
将项目升级到v0.20,清理xcode的构建/运行和捆绑以防万一.我很确定我的代码也没有使用动画库.
有没有办法在 Redux-Saga 中去抖动,其中后续调用在相同的延迟之后排队,这会不断被添加到队列中的每个新任务所影响。类似于 lodash 的 debounce https://lodash.com/docs#debounce。
我目前有一些类似于 redux-saga 的 debounce 的东西,但删除了取消部分,因为我仍然想对每个任务采取行动,我只想将所有事件捆绑在一起,以便稍后在单个线程中触发。
我目前拥有的:
const deferTime = 2000;
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
export function* sendClickEvent (event, debounce) {
if (debounce) {
yield call(delay, deferTime);
}
yield put(action(event));
}
export function* clickSaga () {
while (true) {
const action = yield take(WIDGET_CLICKED);
const state = yield select();
const debounce = action.meta && action.meta.debounce;
const payload = getWidgetClickPayload(state, action);
const defaultData = getDefaultData(state);
const event = …Run Code Online (Sandbox Code Playgroud) 尝试使用 slack 为自定义应用程序设置 oAuth,而 slack 的 API 正在返回{"ok":false,"error":"bad_redirect_uri"}. 我没有为 oauth.access 设置重定向,即使我设置了重定向,我仍然会遇到相同的错误。
该应用程序配置为允许本地主机和公共域。
这是我正在做的请求
const res = await request({
method: 'post',
uri: 'https://slack.com/api/oauth.access',
auth: {
user: process.env.SLACK_CLIENT_ID,
pass: process.env.SLACK_CLIENT_SECRET,
},
form: {
code,
// redirect_uri: 'http://localhost:3100',
},
});
Run Code Online (Sandbox Code Playgroud)
为了启动身份验证流程,我从浏览器调用此 URL:
https://slack.com/oauth/authorize?client_id=XXX&scope=commands,im:read,im:write&redirect_uri=http://localhost:3100/integrations/slack.request&state=ID
我想将HEX(@color)中的基色转换为rgba,并将其用于像.box-shadow(xyb color)这样的mixin中;
我已经看到一大堆mixins将HEX转换为RGBA并设置背景颜色,我知道我可以为box-shadow创建自己的混音.但是有没有通用的解决方案,所以我们可以使用任何现有的mixin.
试过/想要这样的东西(不起作用):
/** Extend LESS functions like (lighten, darken, mix) **/
rgbaColorIn(@color, @opacity : 1){
return rgba( red(@color), green(@color), blue(@color), @opacity );
}
// ----- or ------
/** Passing in a reference to mixin and params **/
.rgbaColorIn(@selector, @params, @color, @opacity : 1){
@rgbaColor: rgba( red(@color), green(@color), blue(@color), @opacity );
@selector(@params @color);
}
Run Code Online (Sandbox Code Playgroud) 尝试在来自 node.js http.createServer 的请求事件中使用异步函数。我想使用 vanilla node.js 模块。我知道我可以使用外部依赖项,但希望在没有理想情况下解决。
我不明白为什么我从 console.logs 看到的 async 函数中取回数据,但 curl resp 不包含它。我没有收到任何错误,比如在 resp 被发回后写标题,所以很困惑为什么 curl 没有{ data: 1 }. 如果我删除 async/await 并将 req.end 硬编码为“测试”,它会在 curl 请求中返回。
服务器.js
const server = http.createServer();
server.on('request', async (req, res) => {
const data = await someAsyncFunc();
console.log(req.url);
console.log(data);
res.end(JSON.stringify(data));
});
Run Code Online (Sandbox Code Playgroud)
终端
curl localhost:3000/test -v
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET /test HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/7.54.0
> …Run Code Online (Sandbox Code Playgroud) 有没有办法在Webstorm发布上运行Gulp任务?
尝试通过webstorm设置但看不到任何东西,Gulp集成对Webstorm 9来说是全新的.
gulp.task('watch', function () {
gulp.watch(paths.watch.css, function(){ compileLESS(paths.src.css, paths.dest.css, {name: 'Style'}) });
gulp.watch(paths.watch.cssBootstrap, function(){ compileLESS(paths.src.cssBootstrap ,paths.dest.cssBootstrap, {suffix: '.min', name: 'Bootstrap'}) });
gulp.watch(paths.watch.scripts, ['scripts']);
gulp.watch(paths.watch.libraries, ['libraries']);
});
Run Code Online (Sandbox Code Playgroud)
只想要一种方法来运行Gulp'watch '(如果项目有吞咽和一项名为watch的任务),我什么时候开始使用Webstorm.
尝试在 Google 应用引擎上启用自动更新 SSL,但 Google 表示找不到 DNS 记录。
我已将它们添加到子域中,尝试执行所有 A 和 AAAA 记录或仅 CNAME 记录(因为 cloudflare 不允许同一子域上的 CNAME 和 A,AAAA),但谷歌找不到 DNS 记录(即使在等待 24 小时后) 。