Skip to content

Update GitHub Actions #4

Update GitHub Actions

Update GitHub Actions #4

Workflow file for this run

name: Build and test Docker image
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.IMAGE_NAME }}:latest
- name: List Docker images
run: docker images
- name: Run Docker container
run: |
docker run --name test-container -d ${{ env.IMAGE_NAME }}:latest
sleep 5
docker logs test-container
docker stop test-container