Add CI #2
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: | |
${{ github.workflow }}-${{ github.ref_name }}-${{ | |
github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: "build image" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and export | |
uses: docker/build-push-action@v6 | |
with: | |
tags: uv-docker-example:latest | |
outputs: type=docker,dest=/tmp/uv-docker-example.tar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: uv-docker-example | |
path: /tmp/uv-docker-example.tar | |
test: | |
name: "test image" | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: uv-docker-example | |
path: /tmp | |
- name: Load image | |
run: | | |
docker load --input /tmp/uv-docker-example.tar | |
docker image ls -a | |
- name: Test image | |
run: ./run.sh hello |