-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (112 loc) · 3.8 KB
/
github-actions-demo.yml
File metadata and controls
123 lines (112 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: GitHub Actions Demo
on:
push:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
maturity:
description: Maturity level of the package
required: true
default: 'release'
type: choice
options:
- ALL
- hotfix
- snapshot
- testing
- release
env:
WORKFLOW_SECRET: 123456
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
with:
lfs: true
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Set PEM Version
run: |
echo "PEM_VERSION=8.5.0" >> $GITHUB_ENV
echo "RELEASE_VERSION=1" >> $GITHUB_ENV
echo "$GITHUB_RUN_ID"
echo "$GITHUB_RUN_NUMBER"
echo "$GITHUB_WORKFLOW"
echo "$GITHUB_PATH"
ls -al $GITHUB_PATH || true
- name: Check folder
run: |
pwd
ls -al
cd docker
ls -al
- name: composite job 1
uses: ./actions/composite
with:
who-to-greet: x86_64
- name: composite job 2
uses: ./actions/composite
with:
who-to-greet: ppc64le
- name: disable step testing
run: |
echo "I am a testing step"
ls -l
md5sum image.png || true
echo "${{ inputs.maturity }}"
echo "${{ inputs.maturity.default }}"
- name: Get maturity
id: get-maturity
uses: ./actions/get/maturity
with:
maturity: ${{ inputs.maturity }}
- name: List files in the repository
run: |
pwd
whoami
mkdir -p builds.edb/debian/x86_64/
ls ${{ github.workspace }} | tee builds.edb/debian/x86_64/edb-pem-files1-deb11_amd64.txt
ls ${{github.workspace}} | tee builds.edb/debian/x86_64/edb-pem-files2-deb11_amd64.txt
- name: Upload packages to artifactory
uses: actions/upload-artifact@v4
with:
name: files
path: builds.edb/debian/x86_64/edb-pem*deb11_amd64.txt
- run: echo "🍏 This job's status is ${{ job.status }}."
Test-GitHub-Actions:
if: ${{ false }} # disable for now
needs: [ Explore-GitHub-Actions ]
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically run after Explore-GitHub-Actions"
- name: disable step testing
if: ${{ false }} # disable for now
run: |
echo "I am a testing step"
Branch-Specific-GitHub-Actions:
if: ${{ github.ref != 'refs/heads/master' }}
needs: [ Explore-GitHub-Actions ]
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job is branch specific"
- name: step testing
run: |
echo "I am a testing step on non-master branch"
Trigger-another-workflow:
needs: [ Explore-GitHub-Actions ]
runs-on: ubuntu-latest
steps:
- name: step testing
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
https://api.github.com/repos/edbjunwang/java-sample-app/actions/workflows/boolean-demo.yaml/dispatches \
-d '{"ref":"master","inputs":{"foo":"true"}}'