Skip to content

Commit

Permalink
Moves docker stuff from deploy into build
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota002 authored and lpsinger committed Dec 3, 2024
1 parent c9d1ee6 commit 9f737bf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 74 deletions.
47 changes: 40 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,57 @@ name: Build and test

on:
pull_request:
push:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{github.repository}}

jobs:
docker:
name: Docker tests
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

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

- name: Build Docker image
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- 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 }}
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value={{date 'YYYYMMDD-HHmmss'}}-{{sha}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
tags: ${{ github.repository }}:test

- name: Test Docker image
run: docker run --rm --user root:root --entrypoint bash ${{ github.repository }}:test -c 'pip install pytest-asyncio && pytest --pyargs gcn_classic_to_kafka'
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

python:
name: Python tests
Expand Down
67 changes: 0 additions & 67 deletions .github/workflows/deploy.yml

This file was deleted.

0 comments on commit 9f737bf

Please sign in to comment.