-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 3.15 KB
/
release.yml
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
name: Release
# This GitHub action runs on each tag created
on:
push:
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
LC_APPLICATION_ID: the-cla
permissions:
contents: write
jobs:
release:
name: Build and Publish Docker Image
# env:
# THIS_VERSION: $(echo "${{ github.ref_name }}" | cut -d 'v' -f2)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build Container and export to Docker
uses: docker/build-push-action@v6
with:
build-args: |
REACT_APP_CLA_URL=${{ secrets.CLA_URL }}
REACT_APP_COMPANY_NAME=${{ secrets.REACT_APP_COMPANY_NAME }}
REACT_APP_COMPANY_WEBSITE=${{ secrets.REACT_APP_COMPANY_WEBSITE }}
REACT_APP_CLA_APP_NAME=${{ secrets.REACT_APP_CLA_APP_NAME }}
REACT_APP_CLA_VERSION=${{ secrets.REACT_APP_CLA_VERSION }}
REACT_APP_GITHUB_CLIENT_ID=${{ secrets.REACT_APP_GITHUB_CLIENT_ID }}
context: .
file: ./Dockerfile
load: true
platforms: linux/amd64
tags: sonatypecommunity/the-cla:latest , sonatypecommunity/the-cla:${{ github.ref_name }}
- name: Sonatype Lifecycle Evaluation
id: evaluate
uses: sonatype/actions/evaluate@v1.0.1
with:
iq-server-url: ${{ vars.SONATYPE_PLATFORM_URL }}
username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }}
password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }}
application-id: ${{ env.LC_APPLICATION_ID }}
scan-targets: 'container:docker.io/sonatypecommunity/the-cla:${{ github.ref_name }} .'
stage: release
- name: Build and Publish
uses: docker/build-push-action@v5
with:
build-args: |
REACT_APP_CLA_URL=${{ secrets.CLA_URL }}
REACT_APP_COMPANY_NAME=${{ secrets.REACT_APP_COMPANY_NAME }}
REACT_APP_COMPANY_WEBSITE=${{ secrets.REACT_APP_COMPANY_WEBSITE }}
REACT_APP_CLA_APP_NAME=${{ secrets.REACT_APP_CLA_APP_NAME }}
REACT_APP_CLA_VERSION=${{ secrets.REACT_APP_CLA_VERSION }}
REACT_APP_GITHUB_CLIENT_ID=${{ secrets.REACT_APP_GITHUB_CLIENT_ID }}
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: sonatypecommunity/the-cla:latest , sonatypecommunity/the-cla:${{ github.ref_name }}