This repository has been archived by the owner on Feb 10, 2025. It is now read-only.
chore: upload Docker image as artifact #18
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: Docker Image CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print Docker version | |
run: docker version | |
- name: Build | |
run: docker build -t hie:${{ github.sha }} . | |
- name: Save Docker image | |
run: docker save hie:${{ github.sha }} -o hie_${{ github.sha }}.tar | |
- name: Upload Docker image as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-image | |
path: hie_${{ github.sha }}.tar | |
- name: Run | |
run: | | |
docker run -d --name hie -p 5888:3000 hie:${{ github.sha }} | |
sleep 10 | |
- name: Test | |
run: | | |
curl --silent --fail http://localhost:5888 || exit 1 |