Skip to content

♻️ Change to reuse the document operation reusable workflow at the do… #112

♻️ Change to reuse the document operation reusable workflow at the do…

♻️ Change to reuse the document operation reusable workflow at the do… #112

Workflow file for this run

name: docker-ci

Check failure on line 1 in .github/workflows/docker-ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-ci.yml

Invalid workflow file

(Line: 79, Col: 14): Unexpected symbol: '<'. Located at position 9 within expression: secrets.<YOUR_API_TOKEN_SECRET>
on:
push:
branches:
- "<your_base_branch>"
paths:
# For GitHub Action
- ".github/workflows/docker-ci.yml"
# For source code and test
- "<your_package_name>/**/*.py"
- "!**/__pkg_info__.py"
# For docker configuration and shell script for running by Docker
- "Dockerfile"
- "scripts/docker/run-server.sh"
# For Python project configuration
- "pyproject.toml"
- "uv.lock"
# For the push event, in addition to build and test would be run, it would trigger other service to keep the reports
# or other checking, i.e., record the test report by CodeCov and check the code quality by SonarQube.
pull_request:
branches:
- "<your_base_branch>"
paths:
# For GitHub Action
- ".github/workflows/docker-ci.yml"
# For source code and test
- "<your_package_name>/**/*.py"
- "!**/__pkg_info__.py"
# For docker configuration and shell script for running by Docker
- "Dockerfile"
- "scripts/docker/run-server.sh"
# For Python project configuration
- "pyproject.toml"
- "uv.lock"
env:
TEST_TAG: user/<your_project_name>:test
TEST_CONTAINER_NAME: <your_project_name>
jobs:
image-check:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- name: Validate build configuration
uses: docker/build-push-action@v6
with:
call: check
tags: user/app:latest
cache-from: type=gha
cache-to: type=gha,mode=max
image-test:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
load: true
tags: ${{ env.TEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test
run: |
docker run -e API_TOKEN=${{ secrets.<YOUR_API_TOKEN_SECRET> }} -d --rm --name ${{ env.TEST_CONTAINER_NAME }} ${{ env.TEST_TAG }}
echo "Waiting for the server to start..."
sleep 5
docker logs ${{ env.TEST_CONTAINER_NAME }}