Skip to content

Update main.yml

Update main.yml #6

Workflow file for this run

name: Create and publish a Docker image
# Trigger on push and on PR against master. Note that we don't push
# containers to the registry if we're doing a PR.
on:
workflow_dispatch:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- path: gnuradio-releases
tag: 3.10
- path: gnuradio-releases-37
tag: 3.7
- path: gnuradio-releases-38
tag: 3.8
- path: gnuradio-releases-39
tag: 3.9
name: Build CI container for ${{ matrix.tag }}
environment: github-action-autobuild
steps:
- name: Checkout repository
uses: actions/checkout@v3
# - name: Log in to the Docker Hub Container registry
# if: ${{ github.event_name != 'pull_request' }}
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the GitHub Container registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/timelf123/docker-gnuradio-smart-meters:${{ matrix.tag }}
file: ${{ matrix.path }}/Dockerfile