mirror of
https://github.com/bensuperpc/infrastructure.git
synced 2025-06-21 09:53:36 +02:00
Update config and add CI
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
32
.github/workflows/main.yml
vendored
Normal file
32
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: infrastructure
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "master"
|
||||
- "dev"
|
||||
paths-ignore:
|
||||
- "**/README.md"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
schedule:
|
||||
- cron: "0 9 * * 2" # every tuesday at 9:00 https://crontab.guru/#0_7_*_*_1
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
image:
|
||||
name: infrastructure
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: "Checkout Code"
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
fetch-depth: 0
|
||||
- name: "Update server"
|
||||
run: make update
|
||||
- name: "Build server"
|
||||
run: make build
|
31
.github/workflows/submodule-update.yml
vendored
Normal file
31
.github/workflows/submodule-update.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: submodule-update
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */8 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
image:
|
||||
name: submodule-update
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout Code"
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.CI_TOKEN }}
|
||||
repository: ${{ github.repository }}
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 1
|
||||
# Update references
|
||||
- name: Git Sumbodule Update
|
||||
run: |
|
||||
git pull --recurse-submodules
|
||||
git submodule update --remote --recursive
|
||||
# Commit and push
|
||||
- name: Commit update
|
||||
run: |
|
||||
git config --global user.name 'Bensuperpc'
|
||||
git config --global user.email 'bensuperpc@gmail.com'
|
||||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||
git commit -am "Auto updated submodule references" && git push || echo "No changes to commit"
|
Reference in New Issue
Block a user