-
Notifications
You must be signed in to change notification settings - Fork 14
48 lines (46 loc) · 2 KB
/
docker-image.yml
File metadata and controls
48 lines (46 loc) · 2 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
name: Docker Image CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
environment:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & push the Docker image
env:
CF_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/your-generated-image:0.0.2
run: |
docker build . --file Dockerfile --tag $CF_IMAGE && docker push $CF_IMAGE
echo "Image should be accessible to your local machine (after docker login) by:"
echo "docker pull $CF_IMAGE"
docker pull $CF_IMAGE
echo "On the next step, the report image would use the integration to pull information on the reported image, and using the specified enrichers."
CF_JIRA_MESSAGE="Example for inserting branch name: $(echo ${GITHUB_REF##*/}) like CR-11027-fix-report "
echo "CF_JIRA_MESSAGE=$CF_JIRA_MESSAGE" >> $GITHUB_ENV
- name: report image by action
with:
# Specify cluster app-proxy
CF_HOST: "${{ secrets.CF_RUNTIME_HOST }}"
CF_API_KEY: "${{ secrets.CF_API_KEY }}"
# use image registry integration - the name of the integration used for pulling information on the image.
CF_CONTAINER_REGISTRY_INTEGRATION: "docker"
# report image generated in previous step
CF_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/your-generated-image:0.0.2
# use github token
CF_GITHUB_TOKEN: ${{ secrets.CF_GITHUB_TOKEN }}
# use jira integration - jira is the name of the integration created in codefresh argo platform.
CF_JIRA_INTEGRATION: "jira"
CF_JIRA_MESSAGE: "${{ env.CF_JIRA_MESSAGE }}"
CF_JIRA_PROJECT_PREFIX: "CR"
uses: codefresh-io/codefresh-report-image@latest