migrate github actions to gitea
Rust / Run tests (push) Successful in 1m22s Details
Docker / Build and push Docker image (push) Successful in 8m48s Details

This commit is contained in:
DataHearth 2023-06-30 11:36:36 +02:00
parent f2e9ee42b4
commit e0b19f8eb4
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
4 changed files with 29 additions and 72 deletions

View File

@ -1,15 +1,23 @@
name: Docker
run-name: Build and push Docker image
on:
push:
tags: ["v*.*.*"]
tags:
- "v*.*.*"
env:
REGISTRY: gitea.antoine-langlois.net
GITEA_REGISTRY: gitea.antoine-langlois.net
GH_REGISTRY: ghcr.io
GH_REPOSITORY: wyll-io/tech-bot
GITEA_REPOSITORY: datahearth/tech-bot
jobs:
build-push:
name: Build and push Docker image
runs-on: debian-docker
steps:
- name: Checkout
uses: actions/checkout@v3
@ -26,17 +34,25 @@ jobs:
- name: Log into registry Gitea
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
registry: ${{ env.GITEA_REGISTRY }}
username: ${{ gitea.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Log into registry GitHub
uses: docker/login-action@v2
with:
registry: ${{ env.GH_REGISTRY }}
username: ${{ gitea.repository_owner }}
password: ${{ secrets.GH_REGISTRY_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ gitea.repository }}
${{ env.REGISTRY }}/${{ gitea.repository }}
${{ env.GITEA_REPOSITORY }}
${{ env.GITEA_REGISTRY }}/${{ env.GITEA_REPOSITORY }}
${{ env.GH_REGISTRY }}/${{ env.GH_REPOSITORY }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
@ -48,6 +64,9 @@ jobs:
context: .
push: true
cache-to: type=inline
cache-from: type=registry,ref=datahearth/tech-bot:latest
cache-from: |
type=registry,ref=${{ env.GITEA_REPOSITORY }}:latest
type=registry,ref=${{ env.GITEA_REGISTRY }}/${{ env.GITEA_REPOSITORY }}:latest
type=registry,ref=${{ env.GH_REGISTRY }}/${{ env.GH_REPOSITORY }}:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,5 +1,7 @@
name: Rust
run-name: Run Rust commands
on:
push:
branches:
@ -13,7 +15,9 @@ env:
jobs:
test:
name: Run tests
runs-on: debian-rust
steps:
- name: Checkout
uses: actions/checkout@v3

View File

@ -1,45 +0,0 @@
name: Docker
on:
push:
tags: ["v*.*.*"]
env:
REGISTRY: ghcr.io
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log into registry GitHub
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: DataHearth
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
push: true
cache-to: type=inline
cache-from: type=registry,ref=datahearth/tech-bot:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,21 +0,0 @@
name: Rust
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose