Introduce GitHub Actions workflows for building and pushing Docker images on master branch pushes and tag pushes. Update Dockerfile base image to Node.js 22 and upgrade Sonar Scanner CLI to version 7.1.0 for improved compatibility and features.
This commit is contained in:
parent
d3575ea71a
commit
2f3f02ae5a
3 changed files with 50 additions and 4 deletions
23
.forgejo/workflows/docker-master.yaml
Normal file
23
.forgejo/workflows/docker-master.yaml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
jobs:
|
||||||
|
docker-master:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: git.van-hemmen.com/actions/kaniko:25.21.1
|
||||||
|
steps:
|
||||||
|
- name: Build & push with Kaniko
|
||||||
|
run: /bin/build.sh
|
||||||
|
env:
|
||||||
|
# --- mandatory --------------------------------------------------------
|
||||||
|
KANIKO_CONTEXT: git://git.van-hemmen.com/GuillaumeHemmen/sonar-scanner.git
|
||||||
|
GIT_REF_NAME: ${{ github.ref_name }}
|
||||||
|
GIT_USERNAME: ${{ secrets.docker_username }}
|
||||||
|
GIT_PASSWORD: ${{ secrets.access_token }}
|
||||||
|
|
||||||
|
# --- optional (only needed when you plan to push) ---------------------
|
||||||
|
REGISTRY_USER: ${{ secrets.docker_username }}
|
||||||
|
REGISTRY_PASS: ${{ secrets.access_token }}
|
||||||
|
KANIKO_DESTINATION: git.van-hemmen.com/guillaumehemmen/sonar-scanner:${GITHUB_SHA},git.van-hemmen.com/guillaumehemmen/sonar-scanner:latest
|
23
.forgejo/workflows/docker-tag.yaml
Normal file
23
.forgejo/workflows/docker-tag.yaml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
jobs:
|
||||||
|
docker-tag:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: git.van-hemmen.com/actions/kaniko:25.21.1
|
||||||
|
steps:
|
||||||
|
- name: Build & push with Kaniko
|
||||||
|
run: /bin/build.sh
|
||||||
|
env:
|
||||||
|
# --- mandatory --------------------------------------------------------
|
||||||
|
KANIKO_CONTEXT: git://git.van-hemmen.com/GuillaumeHemmen/sonar-scanner.git
|
||||||
|
GIT_REF_NAME: ${{ github.ref_name }}
|
||||||
|
GIT_USERNAME: ${{ secrets.docker_username }}
|
||||||
|
GIT_PASSWORD: ${{ secrets.access_token }}
|
||||||
|
|
||||||
|
# --- optional (only needed when you plan to push) ---------------------
|
||||||
|
REGISTRY_USER: ${{ secrets.docker_username }}
|
||||||
|
REGISTRY_PASS: ${{ secrets.access_token }}
|
||||||
|
KANIKO_DESTINATION: git.van-hemmen.com/guillaumehemmen/sonar-scanner:${GITHUB_REF_NAME},git.van-hemmen.com/guillaumehemmen/sonar-scanner:latest
|
|
@ -1,11 +1,11 @@
|
||||||
FROM node:18
|
FROM node:22
|
||||||
|
|
||||||
LABEL maintainer="guillaume@van-hemmen.com"
|
LABEL maintainer="guillaume@van-hemmen.com"
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get -y install wget unzip && \
|
apt-get -y install wget unzip && \
|
||||||
cd /root/ && \
|
cd /root/ && \
|
||||||
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip && \
|
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-linux-x64.zip && \
|
||||||
unzip sonar-scanner-cli-5.0.1.3006-linux.zip && \
|
unzip sonar-scanner-cli-7.1.0.4889-linux-x64.zip && \
|
||||||
ln -sf /root/sonar-scanner-5.0.1.3006-linux/bin/sonar-scanner /usr/local/bin/sonar-scanner && \
|
ln -sf /root/sonar-scanner-cli-7.1.0.4889-linux-x64/bin/sonar-scanner /usr/local/bin/sonar-scanner && \
|
||||||
/usr/local/bin/sonar-scanner --version
|
/usr/local/bin/sonar-scanner --version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue