feat: deploy v0.2.2 #203
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
# This GitHub action runs your tests for each pull request and push. | |
# Optionally, you can turn it on using a schedule for regular testing. | |
on: | |
# pull_request: | |
# paths-ignore: | |
# - 'README.md' | |
pull_request_target: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
env: | |
LC_APPLICATION_ID: the-cla | |
# Testing only needs permissions to read the repository contents. | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build & Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Build | |
run: make all | |
- name: Run Tests | |
run: make test | |
sonatype: | |
name: Sonatype Lifecycle | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
# See https://help.sonatype.com/en/npm-application-analysis.html | |
- name: Install Production Node Dependencies | |
run: corepack yarn install --prod | |
- 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: | |
context: . | |
file: ./Dockerfile | |
load: true | |
platforms: linux/amd64 | |
tags: sonatypecommunity/the-cla:${{ github.sha }} | |
- name: Sonatype Lifecycle Evaluation | |
id: evaluate | |
uses: sonatype/actions/[email protected] | |
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.sha }} .' | |
code_quality: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Run Go Linter | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest |