-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (101 loc) · 3.6 KB
/
release_testing.yml
File metadata and controls
117 lines (101 loc) · 3.6 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
name: Build and push testing image
on:
schedule:
- cron: '15 4 * * *'
workflow_dispatch:
env:
DOTCLEAR_IMAGE: docker-dotclear
DOTCLEAR_CANAL: testing
DOCKER_NAMESPACE: jcpd
jobs:
do_image:
name: Build and push testing image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Get last dotclear repository tag
id: dotclear
uses: oprypin/find-latest-tag@v1
with:
repository: dotclear/dotclear
- name: version
run: |
SUMMARY=$'Last Dotclear repository tag is ${{ steps.dotclear.outputs.tag }}.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: Create repository branch
id: create
uses: peterjgrainger/action-create-branch@v4.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ steps.dotclear.outputs.tag }}
- name: notcreated
if: (steps.create.outputs.created != 'true')
run: |
SUMMARY=$'Branch ${{ needs.check_image.outputs.version }} has not been created.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: created
if: (steps.create.outputs.created == 'true')
run: |
SUMMARY=$' Branch ${{ needs.check_image.outputs.version }} has been created.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: Check out the repo
uses: actions/checkout@v6
with:
ref: ${{ steps.dotclear.outputs.tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to Github registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case github repository
run: |
echo "GITHUB_REPOSITORY=${REPO,,}" >>${GITHUB_ENV}
env:
REPO: '${{ github.repository }}'
- name: Build and push image
uses: docker/build-push-action@v7
with:
context: .
sbom: true
push: true
tags: |
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }}
ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ env.DOTCLEAR_CANAL }}
build-args: CANAL=${{ env.DOTCLEAR_CANAL }}
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Docker Scout
id: docker-scout
uses: docker/scout-action@v1.21.0
with:
command: environment,quickview,cves,recommendations
image: ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }}
environment: testing
organization: ${{ env.DOCKER_NAMESPACE }}
write-comment: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Send Telegram Message Ok
uses: appleboy/telegram-action@master
env:
GITHUB_CONTEXT: ${{toJSON(github)}}
with:
to: ${{ secrets.TELEGRAM_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: Image __${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }}__ successfully generated.