Skip to content

[CI] Building docker image and simple validation #4

[CI] Building docker image and simple validation

[CI] Building docker image and simple validation #4

Workflow file for this run

---
name: Docker
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
BUILD_TAG: wkobiela/ammo_front:PR-${{ github.event.number }}
jobs:
build:
name: Build image
runs-on: self-hosted
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout
uses: actions/checkout@v4
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ BUILD_TAG }}

Check failure on line 32 in .github/workflows/build_docker.yaml

View workflow run for this annotation

GitHub Actions / Docker

Invalid workflow file

The workflow is not valid. .github/workflows/build_docker.yaml (Line: 32, Col: 15): Unrecognized named-value: 'BUILD_TAG'. Located at position 1 within expression: BUILD_TAG
- name: Run Docker container
run: docker run --name test -rm -d -p 3000:3000 $DOCKER_IMAGE_NAME:$BUILD_TAG
- name: Wait until the container is healthy
uses: raschmitt/wait-for-healthy-container/@master
with:
container-name: test
timeout: 120
- name: Verify if working
run: curl -f http://localhost:3000 || exit 1
- name: Remove container and local image
if: always()
run: |
docker rm --force test
docker rmi --force $DOCKER_IMAGE_NAME:$RELEASE_VERSION