Step by step usage
Table of contents
Container actions usage
- Prepare a Jenkinsfile in your repository. You can check the basic syntax of Jenkins pipeline definition.
- Prepare a workflow definition under the
.github/workflows
directory. You can check the official manual for more details. - In your GitHub Action workflow definition, you need to follow these steps when calling other actions in sequence:
- Use a ubuntu runner for the job.
jobs: job-name: runs-on: ubuntu-latest
- If you use jfr-container-action, you need to declare using the
ghcr.io/jenkinsci/jenkinsfile-runner:master
or any image extended it. If you use jfr-static-image-action, you can skip this step.jobs: job-name: runs-on: ubuntu-latest container: image: ghcr.io/jenkinsci/jenkinsfile-runner:master
- Call the
actions/checkout@v2
to pull your codes into the runner. “Call” meansuses
in the workflow definition specifically. You can check the details about “uses” keyword.- uses: actions/checkout@v2
- Call the Jenkinsfile-runner actions.
- If you use jfr-container-action, you need to call
jenkinsci/jfr-container-action@master
and give necessary inputs.uses: jenkinsci/jfr-container-action@master with: command: run jenkinsfile: Jenkinsfile pluginstxt: plugins.txt jcasc: jcasc.yml
- If you use jfr-static-image-action, you need to call
jenkinsci/jfr-static-image-action@master
and give necessary inputs. See the examples for these two actions.uses: jenkinsci/jfr-container-action@master with: command: run jenkinsfile: Jenkinsfile pluginstxt: plugins.txt jcasc: jcasc.yml
- If you use jfr-container-action, you need to call
- Use a ubuntu runner for the job.
Runtime actions usage
- Prepare a Jenkinsfile in your repository.
- Prepare a workflow definition under the
.github/workflows
directory. - In your GitHub Action workflow definition, you need to follow these steps when calling other actions in sequence:
- Use the runners you prefer. You can choose Linux, macOS or Windows.
jobs: job-name: runs-on: ubuntu-latest
- Call the
actions/checkout@v2
to pull your codes into the runner.jobs: job-name: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2
- Set up the Jenkins environment by using
jenkinsci/jfr-setup-action@master
.jobs: job-name: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uese: jenkinsci/jfr-setup-action@master
- Install extra plugins by using
jenkinsci/jfr-plugin-installation-action@master
. This step is optional.jobs: job-name: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uese: jenkinsci/jfr-setup-action@master - uses: jenkinsci/jfr-plugin-installation-action@master with: pluginstxt: plugins.txt
- Run the Jenkins pipeline by using
jenkinsci/jfr-runtime-action@master
.jobs: job-name: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uese: jenkinsci/jfr-setup-action@master - uses: jenkinsci/jfr-plugin-installation-action@master with: pluginstxt: plugins.txt - uses: jenkinsci/jfr-runtime-action@master with: command: run jenkinsfile: Jenkinsfile jcasc: jcasc.yml
- Use the runners you prefer. You can choose Linux, macOS or Windows.