Sleepers version 2.2.0 #120
Workflow file for this run
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: Github-CI Push/PR sleeper | |
on: | |
push: | |
paths: | |
- "services/sleeper/**" | |
- "!**.md" | |
pull_request: | |
paths: | |
- "services/sleeper/**" | |
- "!**.md" | |
env: | |
# secrets can be set in settings/secrets on github | |
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
jobs: | |
build: | |
name: building sleeper | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: [3.11] | |
os: [ubuntu-22.04] | |
node: [16] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: "pip" | |
cache-dependency-path: "**/requirements.txt" | |
- name: install uv | |
uses: yezz123/setup-uv@v1 | |
- name: show versions | |
run: ./ci/helpers/show_system_versions.bash | |
- name: set owner variable | |
run: echo "OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV | |
- name: set docker image tag | |
if: github.ref != 'refs/heads/master' | |
run: echo "DOCKER_IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
- name: set dev environs | |
working-directory: "services/sleeper" | |
run: make devenv | |
- name: get current image if available | |
working-directory: "services/sleeper" | |
run: make pull-latest || true | |
- name: build | |
working-directory: "services/sleeper" | |
run: | | |
make build | |
make info-build | |
- name: test | |
working-directory: "services/sleeper" | |
run: make tests | |
- if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
name: deploy | |
working-directory: "services/sleeper" | |
run: | | |
./../../ci/helpers/dockerhub_login.bash | |
make push | |
- if: github.event_name == 'push' && github.ref != 'refs/heads/master' | |
name: deploy | |
working-directory: "services/sleeper" | |
run: | | |
./../../ci/helpers/dockerhub_login.bash | |
make push-version | |
- name: set up QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- name: setup docker buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: ${{ matrix.docker_buildx }} | |
driver: docker-container # a must for multi-arch buildsplatform | |
- name: build and deploy image for multi-arch | |
if: github.event_name == 'push' | |
working-directory: "services/sleeper" | |
env: | |
DOCKER_TARGET_PLATFORMS: linux/amd64,linux/arm/v7,linux/arm64 | |
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | |
run: | | |
make build push=1 | |
- name: build image for multi-arch | |
if: github.event_name == 'pull_request' | |
working-directory: "services/sleeper" | |
env: | |
DOCKER_TARGET_PLATFORMS: linux/amd64,linux/arm/v7,linux/arm64 | |
run: | | |
make build |