From 1383352e7566b35b8a14fbe98b8ea1f8d118e382 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Fri, 4 Nov 2022 10:27:43 -0400 Subject: [PATCH] create master-build.yml This patch adds the tox and docker image build for the latest container image on every push to master branch --- .github/workflows/master-build.yml | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/master-build.yml diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml new file mode 100644 index 0000000..281a0be --- /dev/null +++ b/.github/workflows/master-build.yml @@ -0,0 +1,51 @@ +name: Test and Build Latest Container Image + +on: + push: + branches: [ "master" ] + +jobs: + tox: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + 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-actions + - 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@v6 + - 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: ./docker + platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 + push: true + tags: | + hemna6969/aprsd:${{ steps.branch-name.outputs.current_branch }} + hemna6969/aprsd:latest