Skip to content

Added branch image push. #283

Added branch image push.

Added branch image push. #283

Workflow file for this run

name: main
on:
push:
pull_request:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Set up docker cache
uses: actions/cache@v3
with:
path: /var/lib/docker
key: ${{ runner.os }}-docker
- name: Set up ccache
uses: actions/cache@v3
with:
path: /tmp/.ccache
key: ${{ runner.os }}-ccache
- name: Checkout
uses: actions/checkout@v3
- name: Docker info
run: docker info
- name: Build sdr-scanner
run: |
echo "constexpr auto GIT_COMMIT = \"$(git rev-parse HEAD)\";" > sources/version.h
echo "constexpr auto GIT_TAG = \"$(git describe --tags)\";" >> sources/version.h
docker build -t sdr-scanner-test --target test .
docker build -t sdr-scanner .
- name: Test sdr-scanner
run: docker run --rm sdr-scanner-test
- name: Deploy sdr-scanner branch
if: github.ref_type == 'branch' && github.event_name != 'pull_request'
run: |
TAG=${GITHUB_REF_NAME}
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io
docker buildx create --use || true
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t docker.io/shajen/sdr-scanner:$TAG --push .
- name: Deploy sdr-scanner tag
if: github.ref_type == 'tag'
run: |
TAG=${GITHUB_REF_NAME/v/}
docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} -p ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} docker.io
docker buildx create --use || true
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t docker.io/shajen/sdr-scanner:$TAG -t docker.io/shajen/sdr-scanner --push .