-
Notifications
You must be signed in to change notification settings - Fork 65
52 lines (50 loc) · 1.83 KB
/
atomfeed_console_build_publish.yaml
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
name: Build and Publish atomfeed-console Image
on:
push:
branches: [master]
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths:
- 'atomfeed-console/**'
- '.github/workflows/atomfeed_console_build_publish.yaml'
repository_dispatch:
types:
- atomfeed-console-trigger
jobs:
Trivy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Trivy Scan
run: ./.github/trivy_scan.sh atomfeed-console .github/workflows/atomfeed_console_build_publish.yaml
docker-build-publish:
name: Docker Build & Publish
runs-on: ubuntu-latest
needs: Trivy
steps:
- uses: actions/checkout@v4
- name: Set env.ARTIFACT_VERSION
run: |
wget -q https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/setArtifactVersion.sh && chmod +x setArtifactVersion.sh
./setArtifactVersion.sh
rm setArtifactVersion.sh
- name: Download atomfeed-console jar
run: |
curl -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/ICT4H/atomfeed-console/actions/artifacts | \
jq -r '.artifacts[0].archive_download_url' | \
xargs curl -L -o atomfeed-console-SNAPSHOT.zip -H "Authorization: token ${{secrets.BAHMNI_PAT}}"
unzip atomfeed-console-SNAPSHOT.zip -d atomfeed-console/resources/
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker Build and push
uses: docker/build-push-action@v2
with:
context: atomfeed-console/
no-cache: true
push: true
tags: bahmni/atomfeed-console:${{env.ARTIFACT_VERSION}},bahmni/atomfeed-console:latest