Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
martabal committed May 26, 2024
1 parent bc91c5e commit 5f2318d
Show file tree
Hide file tree
Showing 9 changed files with 220 additions and 266 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Build
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
push:
branches:
- "main"

jobs:
build:
name: Run build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build
- name: Run build
run: cargo build
if: ${{ !cancelled() }}
23 changes: 10 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Docker Build

on:
workflow_dispatch:
inputs:
Expand All @@ -15,22 +14,25 @@ on:
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
packages: write

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "main"
fetch-depth: 0

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository_owner }}/${{ github.event.repository.name }}
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
tags: |
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
Expand All @@ -46,24 +48,19 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./
platforms: linux/amd64,linux/arm64
platforms: linux/arm/v7,linux/amd64,linux/arm64
push: ${{ !github.event.pull_request.head.repo.fork }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BUILD_VERSION=${{ github.event.release.name }}
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
push:
branches:
- "main"

jobs:
test:
name: Run tests
Expand All @@ -15,9 +15,11 @@ jobs:

- name: Run tests
run: cargo test
if: ${{ !cancelled() }}

- name: Run formatter
run: cargo fmt -- --check
if: ${{ !cancelled() }}

- name: Run clippy
run: cargo clippy
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.env
.venv/

config.yaml
config.toml
Loading

0 comments on commit 5f2318d

Please sign in to comment.