Skip to content

Commit d39f866

Browse files
Initial commit [skip ci]
0 parents  commit d39f866

30 files changed

Lines changed: 697 additions & 0 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Install and Cache Node Modules'
2+
description: 'Some Description'
3+
inputs:
4+
caching:
5+
required: false
6+
description: "enable or disable caching"
7+
default: 'true'
8+
outputs:
9+
status:
10+
value: 'Active'
11+
description: "Some Status"
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Cache node_modules
16+
if: inputs.caching == 'true'
17+
id: cache-step
18+
uses: actions/cache@v3
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-cache-file-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-cache-file-
24+
${{ runner.os }}-
25+
- name: Display Cache
26+
run: echo '${{ toJSON(steps.cache-step.outputs) }}'
27+
shell: bash
28+
- name: Install node_modules
29+
run: npm install
30+
shell: bash

.github/workflows/concurrency.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Concurrency Testing
2+
on: workflow_dispatch
3+
concurrency:
4+
group: concurrency-testing
5+
cancel-in-progress: true
6+
jobs:
7+
test-timeout:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Some Step
11+
run: sleep 50
12+
timeout-minutes: 1

.github/workflows/docker.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docker Test
2+
on: push
3+
4+
jobs:
5+
test-docker-container:
6+
runs-on: ubuntu-latest
7+
services:
8+
customMysql:
9+
image: mysql
10+
container:
11+
image: node:21-alpine3.17
12+
env:
13+
NODE_ENV: develpment
14+
ports:
15+
- 80
16+
steps:
17+
- name: Display service image
18+
run: echo '${{ toJSON(job.services) }}'
19+
- name: Display Node Version
20+
run: |
21+
node -v
22+
cat /etc/os-release
23+
- name: Print new Node Version
24+
uses: docker://node:18-buster-slim
25+
with:
26+
args: -v
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Eighth Workflow
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
titleCustom:
6+
description: Type the Title
7+
type: string
8+
required: true
9+
default: "Hello World"
10+
selectCustom:
11+
description: Select Value
12+
type: choice
13+
required: true
14+
options:
15+
- Value 1
16+
- Value 2
17+
- Value 3
18+
- Value 4
19+
default: "Value 2"
20+
checkCustom:
21+
description: Checkbox
22+
type: boolean
23+
required: false
24+
25+
jobs:
26+
run-first-command:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Event Vars
30+
run: |
31+
echo "Title: ${{ inputs.titleCustom }}"
32+
echo "Title: ${{ inputs.selectCustom }}"
33+
echo "Title: ${{ inputs.checkCustom }}"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Eleventh Workflow
2+
on: [push]
3+
env:
4+
WF_CUSTOM_VAR: WF 1
5+
jobs:
6+
run-first-command:
7+
runs-on: ubuntu-latest
8+
env:
9+
JOB_CUSTOM_VAR: JOB 1
10+
steps:
11+
- name: Set New Var
12+
run: echo "NEW_CUSTOM_VAR=New Value" >> "$GITHUB_ENV"
13+
- name: Vars
14+
env:
15+
STEP_CUSTOM_VAR: STEP 1
16+
WF_CUSTOM_VAR: WF 1 - STEP 2
17+
run: |
18+
echo $GITHUB_REF
19+
echo '${{ github.ref }}'
20+
echo $WF_CUSTOM_VAR
21+
echo '${{ env.WF_CUSTOM_VAR }}'
22+
echo $JOB_CUSTOM_VAR
23+
echo $STEP_CUSTOM_VAR
24+
echo $NEW_CUSTOM_VAR
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Fifteenth Workflow
2+
on: push
3+
4+
jobs:
5+
first-jobs:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Math expression
9+
run: expr 2 + 2 > math-result.txt
10+
- name: Upload result file
11+
uses: actions/upload-artifact@v3
12+
with:
13+
name: math-result
14+
path: math-result.txt
15+
another-job:
16+
runs-on: ubuntu-latest
17+
needs: first-jobs
18+
steps:
19+
- name: Download file
20+
uses: actions/download-artifact@v3
21+
with:
22+
name: math-result
23+
- name: Math Expression
24+
run: |
25+
value=`cat math-result.txt`
26+
expr $value \* 2 > math-result.txt
27+
- name: Upload result file
28+
uses: actions/upload-artifact@v3
29+
with:
30+
name: math-result
31+
path: math-result.txt
32+
second-job:
33+
runs-on: ubuntu-latest
34+
needs: another-job
35+
steps:
36+
- name: Download file
37+
uses: actions/download-artifact@v3
38+
with:
39+
name: math-result
40+
- name: Print File
41+
run: |
42+
value=`cat math-result.txt`
43+
echo $value
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Fifth Workflow
2+
on:
3+
issues:
4+
types: [edited, deleted]
5+
pull_request:
6+
types: [assigned, closed]
7+
8+
jobs:
9+
run-first-command:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Event Vars
13+
run: |
14+
echo $GITHUB_SHA
15+
echo $GITHUB_REF
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: First Workflow
2+
on: push
3+
4+
jobs:
5+
run-first-command:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Display some Text
9+
run: echo "Some Text"
10+
- name: Command in Multiline
11+
run: |
12+
node -v
13+
npm -v

0 commit comments

Comments
 (0)