mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-15 21:01:47 -05:00
Hemna
afeb11a085
This patch reworks the main Dockerfile to do builds for both the pypi upstream release of aprsd as well as the github repo branch of aprsd for development. This eliminates the need for Dockerfile-dev. This patch also installs aprsd as a user in the container image instead of as root.
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: Test and Build Latest Container Image
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 10 * * *"
|
|
push:
|
|
branches:
|
|
- "**"
|
|
tags:
|
|
- "v*.*.*"
|
|
pull_request:
|
|
branches:
|
|
- "master"
|
|
|
|
jobs:
|
|
tox:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.9", "3.10", "3.11"]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install tox tox-gh>=1.2
|
|
- name: Test with tox
|
|
run: tox
|
|
|
|
build:
|
|
needs: tox
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Get Branch Name
|
|
id: branch-name
|
|
uses: tj-actions/branch-names@v8
|
|
- name: Setup QEMU
|
|
uses: docker/setup-qemu-action@v2
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
- name: Login to Docker HUB
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build the Docker image
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: "{{defaultContext}}:docker"
|
|
platforms: linux/amd64,linux/arm64
|
|
file: ./Dockerfile
|
|
build-args: |
|
|
INSTALL_TYPE=github
|
|
BRANCH=${{ steps.branch-name.outputs.current_branch }}
|
|
BUILDX_QEMU_ENV=true
|
|
push: true
|
|
tags: |
|
|
hemna6969/aprsd:${{ steps.branch-name.outputs.current_branch }}
|