Skip to content

Update dependency ruff to v0.7.1 (#226) #104

Update dependency ruff to v0.7.1 (#226)

Update dependency ruff to v0.7.1 (#226) #104

on:
push:
branches: ["main"]
paths:
- "server/**"
- ".github/workflows/publish_server.yml"
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Rebuild every Sunday at 00:00
env:
REGISTRY: ghcr.io
jobs:
build-and-push-image:
runs-on: [self-hosted, linux, jammy, x64]
permissions:
contents: read
packages: write
env:
IMAGE_NAME: ${{ github.repository }}/hwapi
timeout-minutes: 600 # 10 hours
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."docker.io"]
mirrors = ["https://github-runner-dockerhub-cache.canonical.com:5000"]
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push backend Docker image
uses: docker/build-push-action@v6
with:
context: ./server/
file: ./server/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-and-push-charm:
runs-on: [self-hosted, linux, xlarge, jammy, x64]
needs: build-and-push-image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upload charm to charmhub
uses: canonical/charming-actions/[email protected]
with:
charm-path: "server/charm"
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
upload-image: "true"