Skip to content

Commit

Permalink
moving to our actions
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascooper committed Oct 25, 2024
1 parent 2085798 commit 7950618
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 130 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/add-labels-main.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/backport.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/build-package-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build, Test, Package, and Publish

# AI Chat Ad Server application CI/CD pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: expedient/elastic-connectors

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r requirements/tests.txt
- name: Run unit tests
run: |
python -m unittest discover tests
- name: Build application
run: |
echo "Building application..."
# Add any additional build steps here if needed
build-and-push-image:
needs: build-and-test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

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

- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.2'

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
29 changes: 0 additions & 29 deletions .github/workflows/label-community-issues.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/scripts/label_community_issues.py

This file was deleted.

0 comments on commit 7950618

Please sign in to comment.