Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
flc1125 committed Sep 18, 2023
1 parent f4e0dd5 commit 4d82323
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 4 deletions.
105 changes: 101 additions & 4 deletions pages/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ layout: default
- 依赖和条件
- 存储和共享数据
- 自定义动作
- 安全性和凭证管理

---

Expand Down Expand Up @@ -96,14 +95,112 @@ jobs:
## 高级特性 <small>依赖和条件</small>
<div class="flex gap-4">
<div>
<v-click>
#### 依赖
</v-click>
<div v-click class="h-90 overflow-auto">
```yaml
name: Test Jobs

on:
workflow_dispatch:
inputs:
test-jobs:
description: '测试 Jobs'

jobs:
jobs-1:
runs-on: ubuntu-latest
steps:
- name: Run a one-line script
run: echo Hello, world! This is jobs-1

jobs-2:
runs-on: ubuntu-latest
needs: # 依赖设定
- jobs-1
steps:
- name: Run a one-line script
run: echo Hello, world! This is jobs-3, but after jobs-1
```
</div>
</div>
<div>
<v-click>
#### 条件
</v-click>
<div v-click class="h-90 overflow-auto">
```yaml
name: Test IF

on:
workflow_dispatch:
inputs:
test-jobs:
description: '测试 IF'

env:
ENVIRONMENT: prod

jobs:
dev:
runs-on: ubuntu-latest
steps:
- run: echo The dev env is ${{ env.ENVIRONMENT }}
if: env.ENVIRONMENT == 'dev'

- run: echo The prod env is ${{ env.ENVIRONMENT }}
if: env.ENVIRONMENT == 'prod'
```
</div>
</div>
</div>
---
## 高级特性 <small>存储和共享数据</small>
<div>
<img src="/assets/images/advanced-2.png" class="w-100" />
</div>
<v-click>
**说明:**
</v-click>
<v-clicks>
- 表达式:https://docs.github.com/zh/actions/learn-github-actions/expressions
- 您需要使用特定语法指示 GitHub 对表达式求值,而不是将其视为字符串。 `${{ <expression> }}`
在 `if` 条件下使用表达式时,可以省略 `${{ }}` 表达式语法,因为 GitHub Actions 会自动将 `if` 条件作为表达式求值。 使用 `${{ }}` 表达式语法将内容转换为字符串,并且字符串是真值。 例如,**`if: true && ${{ false }}` 的计算结果为 `true`**。

</v-clicks>

---

## 高级特性 <small>自定义动作</small>
## 高级特性 <small>存储和共享数据</small>

---

## 高级特性 <small>安全性和凭证管理</small>
## 高级特性 <small>自定义动作</small>
Binary file added public/assets/images/advanced-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d82323

Please sign in to comment.