This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
initial commit #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push Docker image to latest | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build-api-container-latest: | |
runs-on: | |
group: synapsec-larger-runners | |
permissions: | |
contents: read # Default permission to read repository contents | |
packages: write # Permission to write to GitHub Packages | |
env: | |
IMAGE_NAME: llm-defender-api | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Podman | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y podman | |
- name: Build Podman image | |
run: podman build -t ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest -f api.Dockerfile | |
- name: Log in to GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
- name: Push Podman image | |
run: podman push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | |
- name: Store image details | |
run: echo "{name}={image::ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest}" >> $GITHUB_OUTPUT | |
build-validator-container-latest: | |
runs-on: | |
group: synapsec-larger-runners | |
permissions: | |
contents: read # Default permission to read repository contents | |
packages: write # Permission to write to GitHub Packages | |
env: | |
IMAGE_NAME: llm-defender-validator | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Podman | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y podman | |
- name: Build Podman image | |
run: podman build -t ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest -f validator.Dockerfile | |
- name: Log in to GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
- name: Push Podman image | |
run: podman push ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | |
- name: Store image details | |
run: echo "{name}={image::ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest}" >> $GITHUB_OUTPUT |