Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2e7dcb3
add push.yaml
ryu9663 May 12, 2024
bdf713b
add push.yaml
ryu9663 May 12, 2024
4b081e2
add push.yaml
ryu9663 May 12, 2024
6c146ad
add pull_request.yaml
ryu9663 May 12, 2024
609426c
add pull_request.yaml
ryu9663 May 12, 2024
3695758
issue.yaml
ryu9663 May 12, 2024
0f9dae7
Add issue_comment.yaml
ryu9663 May 12, 2024
1df261a
workflow dispatch
ryu9663 May 12, 2024
a2f192b
multiple-events-workflow.yaml
ryu9663 May 12, 2024
414da9c
needs.yaml
ryu9663 May 12, 2024
b62248f
rerun test
ryu9663 May 12, 2024
1df4fc1
checkout
ryu9663 May 13, 2024
16d9c79
context1
ryu9663 May 13, 2024
ddc3dd5
context2
ryu9663 May 13, 2024
7bd7342
path_filter
ryu9663 May 13, 2024
251670c
edit push.yaml
ryu9663 May 13, 2024
2fa008a
edit path_filter
ryu9663 May 13, 2024
ae2deb4
edit pr
ryu9663 May 13, 2024
240a234
edit push
ryu9663 May 13, 2024
7c450c1
tag
ryu9663 May 13, 2024
4127837
timeout
ryu9663 May 13, 2024
6b1dd36
timeout
ryu9663 May 13, 2024
a3039f6
cache
ryu9663 May 14, 2024
799dd46
edit app.js
ryu9663 May 14, 2024
5fe4774
artifact
ryu9663 May 14, 2024
b71a4ba
output
ryu9663 May 14, 2024
fbbbb72
output
ryu9663 May 14, 2024
9a1b08b
env1
ryu9663 May 14, 2024
2e68998
matrix
ryu9663 May 14, 2024
a1ff9ad
if
ryu9663 May 14, 2024
ca8c613
if
ryu9663 May 14, 2024
616fa5f
if-2
ryu9663 May 14, 2024
6a5da09
if-2-always
ryu9663 May 14, 2024
6c0f683
if-2-always2
ryu9663 May 14, 2024
97263ac
startswith
ryu9663 May 14, 2024
f0458b0
part3
ryu9663 May 17, 2024
4827d75
add slack webhook
ryu9663 May 17, 2024
7fbde7d
k
ryu9663 May 17, 2024
a1c3619
k
ryu9663 May 17, 2024
7b614a9
k
ryu9663 May 17, 2024
7a1a7ea
k
ryu9663 May 17, 2024
323245e
k
ryu9663 May 17, 2024
4938e6b
k
ryu9663 May 17, 2024
451173f
cicd-1.yaml
ryu9663 May 18, 2024
5d64723
k
ryu9663 May 18, 2024
6e4dfbc
cicd test
ryu9663 May 18, 2024
f72903f
k
ryu9663 May 18, 2024
215e258
kk
ryu9663 Dec 12, 2024
b19ed51
kk
ryu9663 Dec 12, 2024
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
28 changes: 28 additions & 0 deletions .github/workflows/cicd-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: cicd-1
on:
pull_request:
types: [opened, synchronize, closed]
branches: [dev]
paths:
- "my-app/**"
jobs:
test:
if: github.event.action == 'opened' || github.event.action == 'synchronize'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

image-build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

deploy:
runs-on: ubuntu-latest
needs: [image-build]
steps:
- name: checkout
uses: actions/checkout@v4
27 changes: 27 additions & 0 deletions .github/workflows/part1/workflow_dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: workflow_dispatch
on:
workflow_dispatch:
inputs:
name:
description: "set name"
required: true
default: "github-actions"
type: string
environment:
description: "set env"
required: true
default: "dev"
type: choice
options:
- dev
- qa
- prod

jobs:
workflow-dispatch-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo ${{ inputs.name }}
- name: step2
run: echo ${{ inputs.environment }}
15 changes: 15 additions & 0 deletions .github/workflows/part1/issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: issue-workflow
on:
issues:
types: [opened]

jobs:
issue-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
17 changes: 17 additions & 0 deletions .github/workflows/part1/issue_comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: issue_comment_workflow
on: issue_comment

jobs:
pr-comment:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: pr comment
run: echo ${{ github.event.issue.pull_request }}

issue_comment:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: issue comment
run: echo ${{ github.event.issue.pull_request }}
17 changes: 17 additions & 0 deletions .github/workflows/part1/multiple_events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: multiple-events-workflow
on:
push:
issues:
types: [opened]
workflow_dispatch:

jobs:
multiple-events-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
40 changes: 40 additions & 0 deletions .github/workflows/part1/needs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: needs
on: push

jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
job2:
needs: [job1]
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
job3:
runs-on: ubuntu-latest
steps:
- name: step1
run: |
echo "job3 failed"
exit 1
job4:
needs: [job3]
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
14 changes: 14 additions & 0 deletions .github/workflows/part1/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pull-request-workflow-hello
on:
pull_request:
types: [opened]
jobs:
pull-request-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
12 changes: 12 additions & 0 deletions .github/workflows/part1/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: push-workflow-hello3
on: push
jobs:
push-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
14 changes: 14 additions & 0 deletions .github/workflows/part1/re-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: re-run
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
- name: cat readme
run: cat README.md
25 changes: 25 additions & 0 deletions .github/workflows/part2/artifact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: artifact
on: push

jobs:
upload-artifact:
runs-on: ubuntu-latest
steps:
- name: echo
run: echo hello-world > hello.txt
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: artifact-test
path: ./hello.txt
download-artifact:
runs-on: ubuntu-latest
needs: upload-artifact
steps:
- name: download artifact
uses: actions/download-artifact@v3
with:
name: artifact-test
path: ./
- name: check
run: cat hello.txt
4 changes: 4 additions & 0 deletions .github/workflows/part2/branch_filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: branch-filter
on:
push:
branches: ["dev"]
30 changes: 30 additions & 0 deletions .github/workflows/part2/cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: cache
on:
push:
paths:
- "my-app/**"
jobs:
cache:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
cd my-app
npm ci
- name: Build
run: |
cd my-app
npm run build
17 changes: 17 additions & 0 deletions .github/workflows/part2/checkout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: checkout_workflow
on: workflow_dispatch

jobs:
no-checkout-job:
runs-on: ubuntu-latest
steps:
- name: check file list
run: cat README.md

checkout-job:
runs-on: ubuntu-latest
steps:
- name: use checkout action
uses: actions/checkout@v2
- name: check file list
run: cat README.md
13 changes: 13 additions & 0 deletions .github/workflows/part2/context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: context
on: workflow_dispatch

jobs:
context:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo '${{ toJSON(github) }}'
- name: check github context
run: |
echo ${{ github.repository }}
echo ${{ github.event_name }}
28 changes: 28 additions & 0 deletions .github/workflows/part2/if-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: if-1
on:
push:
workflow_dispatch:

jobs:
job1:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: step1
run: echo hello world
job2:
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
- name: step1
run: echo hello world

job3:
runs-on: ubuntu-latest
steps:
- name: echo PUSH
if: github.event_name == 'push'
run: echo PUSH
- name: echo WORKFLOW_DISPATCH
if: github.event_name != 'push'
run: echo WORKFLOW_DISPATCH
20 changes: 20 additions & 0 deletions .github/workflows/part2/if-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: if-2
on: push

jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: exit 1
run: exit 1
- name: echo hello world
if: always()
run: echo hello world

job2:
needs: [job1]
runs-on: ubuntu-latest
if: always()
steps:
- name: echo hello world
run: echo hello world
15 changes: 15 additions & 0 deletions .github/workflows/part2/matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: matrix
on: push

jobs:
get-matrix:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [12, 14]
runs-on: ${{ matrix.os }}
steps:
- name: check matrix
run: |
echo ${{ matrix.os }}
echo ${{ matrix.node }}
23 changes: 23 additions & 0 deletions .github/workflows/part2/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: output
on: push
jobs:
create-output:
runs-on: ubuntu-latest
outputs:
test: ${{ steps.check-output.outputs.test }}
steps:
- name: echo output
id: check-output
run: |
echo "test=hello" >> $GITHUB_OUTPUT
- name: check output
run: |
echo ${{ steps.check-output.outputs.test }}

get-output:
runs-on: ubuntu-latest
needs: create-output
steps:
- name: check output
run: |
echo ${{ needs.create-output.outputs.test }}
13 changes: 13 additions & 0 deletions .github/workflows/part2/path_filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: path-filter
on:
push:
paths:
- ".github/workflows/part1/*"
- "!.github/workflows/part1/push.yaml"

jobs:
push-filter:
runs-on: ubuntu-latest
steps:
- name: echo
run: echo "This is a push event with path filter"
Loading