Skip to content

Check for online agents when submitting a job (#423) #57

Check for online agents when submitting a job (#423)

Check for online agents when submitting a job (#423) #57

name: Release testflinger-k8s charm to latest/edge
on:
push:
branches:
- main
paths:
- server/**
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build-and-push-charm:
runs-on: [self-hosted, linux, jammy, X64]
permissions:
contents: read
packages: write
env:
IMAGE_NAME: ${{ github.repository }}
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@7ca345011ac4304463197fac0e56eab1bc7e6af0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@44d81d6d2a5a935e1a481942268529623f1f5ccd
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push backend Docker image
uses: docker/build-push-action@5e99dacf67635c4f273e532b9266ddb609b3025a
with:
context: ./server
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Upload charm to charmhub
uses: canonical/charming-actions/upload-charm@2.4.0
with:
charm-path: server/charm
credentials: "${{ secrets.CHARMHUB_TOKEN }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
channel: "latest/edge"