Replace build workflow with daily GitLab repository clone.
Removed the build-and-test.yml GitHub Actions workflow, including Maven build and Sonar integration. Introduced a new workflow to clone a GitLab repository daily using a scheduled cron job.
This commit is contained in:
@@ -1,36 +0,0 @@
|
|||||||
name: Build and Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
- feature*
|
|
||||||
pull_request:
|
|
||||||
types: [ opened, synchronize, reopened ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
mvn-sonar:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up JDK 17
|
|
||||||
uses: actions/setup-java@v4.5.0
|
|
||||||
with:
|
|
||||||
java-version: '17'
|
|
||||||
distribution: 'corretto'
|
|
||||||
- name: Cache maven repository
|
|
||||||
uses: actions/cache@v4.2.0
|
|
||||||
with:
|
|
||||||
path: ~/.m2/repository
|
|
||||||
key: maven
|
|
||||||
restore-keys: maven
|
|
||||||
- name: Build with Maven verify for sonar
|
|
||||||
env:
|
|
||||||
API_EMAIL: ${{ secrets.API_EMAIL }}
|
|
||||||
API_KEY: ${{ secrets.API_KEY }}
|
|
||||||
API_TOKEN: ${{ secrets.API_TOKEN }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=th-schwarz_CloudflareDNS-java
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: Clone GitLab Repository Daily
|
||||||
|
|
||||||
|
# Schedule the workflow to run daily at midnight
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *' # Adjust the cron schedule as required (UTC)
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clone-gitlab-repo:
|
||||||
|
name: Clone GitLab Repository
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Clone GitLab repository
|
||||||
|
env:
|
||||||
|
# Set the GitLab access token in GitHub secrets as `GITLAB_TOKEN`
|
||||||
|
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Authenticate using GitLab token
|
||||||
|
git clone https://gitlab-ci-token:${GITLAB_TOKEN}@thischwa/CloudflareDNS-java.git cloned-repo
|
||||||
Reference in New Issue
Block a user