Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt committed Mar 21, 2024
1 parent 1af720e commit 6fd3eb8
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Onyxia API CI

on:
push:
branches:
- "**"
paths-ignore:
- 'docs/**'
tags:
- "*"
pull_request:
paths-ignore:
- 'docs/**'

jobs:
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: crazy-max/[email protected]
with:
images: estragonthecat/onyxia-api
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: onyxia-api
platforms: linux/amd64
file: onyxia-api/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.docker_meta.outputs.tags }}
${{ github.ref == 'refs/heads/main' && 'estragonthecat/onyxia-api:latest' || '' }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit 6fd3eb8

Please sign in to comment.