infra: move docker workflow into gentoo-utils workflow
infra: add build job to CI
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
name: Build gentoo-utils docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.docker/Dockerfile'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.docker/Dockerfile'
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
jobs:
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
-
|
||||
name: Set up Docker buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
-
|
||||
name: Log in to Github Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.epenguin.net
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.CI_TOKEN }}
|
||||
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: git.epenguin.net/${{ gitea.repository }}:latest
|
||||
context: "{{defaultContext}}:.docker"
|
||||
59
.gitea/workflows/gentoo-utils.yml
Normal file
59
.gitea/workflows/gentoo-utils.yml
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Gentoo Utils
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build-docker:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
steps:
|
||||
-
|
||||
name: Checkout repo
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check for changes before building
|
||||
id: image-changes
|
||||
run: |
|
||||
if git diff --name-only ${{ gitea.event.before }} ${{ gitea.sha }} | grep -q '^\.docker/'; then
|
||||
echo "changes_detected=true" >> $GITEA_OUTPUT
|
||||
else
|
||||
echo "changes_detected=false" >> $GITEA_OUTPUT
|
||||
fi
|
||||
-
|
||||
name: Set up Docker buildx
|
||||
if: steps.docker-changes.outputs.changes_detected == 'true'
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
-
|
||||
name: Log in to Github Container Registry
|
||||
if: steps.docker-changes.outputs.changes_detected == 'true'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.epenguin.net
|
||||
username: ${{ vars.CI_BOT_USERNAME }}
|
||||
password: ${{ secrets.CI_BOT_TOKEN }}
|
||||
|
||||
-
|
||||
name: Build and push
|
||||
if: steps.docker-changes.outputs.changes_detected == 'true'
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: git.epenguin.net/${{ gitea.repository }}:latest
|
||||
context: "{{defaultContext}}:.docker"
|
||||
|
||||
build:
|
||||
runs-on: gentoo-utils
|
||||
needs: build-docker
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: build and check
|
||||
run: ./check.sh
|
||||
Reference in New Issue
Block a user