2025-01-02 15:17:00 +00:00
|
|
|
on:
|
2025-02-08 23:05:27 +01:00
|
|
|
workflow_dispatch:
|
2025-01-02 15:17:00 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2025-01-02 15:33:46 +00:00
|
|
|
schedule:
|
2025-01-03 16:22:25 +00:00
|
|
|
- cron: "@weekly"
|
2025-01-02 15:17:00 +00:00
|
|
|
|
|
|
|
jobs:
|
2025-02-09 20:47:16 +01:00
|
|
|
sonar:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: hadolint/hadolint-action@v3.1.0
|
|
|
|
with:
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
output-file: hadolint.out
|
|
|
|
format: sonarqube
|
|
|
|
no-fail: true
|
|
|
|
|
|
|
|
- name: SonarQube Scan
|
|
|
|
uses: SonarSource/sonarqube-scan-action@v4.2.1
|
|
|
|
env:
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
|
|
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST_URL }}
|
|
|
|
|
2025-01-02 16:21:13 +00:00
|
|
|
release:
|
2025-01-02 15:17:00 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2025-01-02 16:13:08 +00:00
|
|
|
- name: Update Docker configuration
|
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
|
|
|
mkdir -p /etc/default
|
|
|
|
mkdir -p /etc/docker
|
|
|
|
touch -a /etc/default/docker
|
|
|
|
touch -a /etc/docker/daemon.json
|
|
|
|
echo "DOCKER_OPTS=\"--insecure-registry ${{ vars.PACKAGES_REGISTRY_URL }}\"" >> /etc/default/docker
|
|
|
|
echo "{\"insecure-registries\": [\"${{ vars.PACKAGES_REGISTRY_URL }}\"]}" > /etc/docker/daemon.json
|
2025-01-02 16:06:25 +00:00
|
|
|
|
2025-01-02 15:17:00 +00:00
|
|
|
- name: Check out repository code
|
2025-01-02 15:29:22 +00:00
|
|
|
uses: actions/checkout@v4.2.2
|
2025-01-02 15:17:00 +00:00
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
2025-01-02 16:21:13 +00:00
|
|
|
- name: Log in to Gitea Package Registry
|
2025-01-02 16:26:38 +00:00
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: ${{ vars.PACKAGES_REGISTRY_URL }}
|
|
|
|
username: ${{ vars.PACKAGES_REGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.PACKAGES_REGISTRY_PASSWORD }}
|
2025-01-02 15:17:00 +00:00
|
|
|
|
2025-01-02 16:21:13 +00:00
|
|
|
- name: Build image
|
2025-01-02 16:26:38 +00:00
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: false
|
2025-01-03 16:22:25 +00:00
|
|
|
load: true
|
2025-01-02 16:26:38 +00:00
|
|
|
tags: ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest
|
2025-01-03 16:22:25 +00:00
|
|
|
|
2025-01-02 16:21:13 +00:00
|
|
|
- name: Push image
|
|
|
|
run: docker push ${{ vars.PACKAGES_REGISTRY_URL }}/${{ gitea.repository }}:latest
|