Skip to content

Hotfix/1.3.4

Hotfix/1.3.4 #55

Workflow file for this run

name: Build
on:
pull_request:
push:
branches: [main, develop]
tags: ['*']
workflow_dispatch:
env:
REGISTRY: ghcr.io
BASE_REPO: ubuntu
BASE_TAG: "22.04"
jobs:
build-and-publish:
name: Build and push the docker images
strategy:
matrix:
build: [Dev, Prod]
include:
- push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
- build: Dev
tag-suffix: '-dev'
- build: Prod
tag-suffix: ''
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
submodules: recursive
# Need to avoid a shallow clone (fetch-depth=1) so that the lookup of the tag works
fetch-depth: 0
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
flavor: |
latest=auto
suffix=${{ matrix.tag-suffix }},onlatest=true
tags: |
type=semver,pattern={{raw}}
type=ref,event=branch
type=ref,event=pr
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get previous tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
id: tag_name
with:
fallback: beta
- name: Build
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.build }}/Dockerfile
push: ${{ matrix.push }}
build-args: |
img_repo=${{ env.BASE_REPO }}
img_tag=${{ env.BASE_TAG }}
common_tag=${{ steps.tag_name.outputs.tag }}
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: ${{ matrix.push && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ matrix.push }}
# notify-packages:
#
# if: |
# (github.event_name == 'push' && contains(github.ref, 'refs/tags/') )
# || github.event_name == 'release'
# || github.event_name == 'workflow_dispatch'
# name: Trigger new docker images of the P8 software packages
# runs-on: ubuntu-latest
# needs: [build-and-publish]
# strategy:
# matrix:
# repo: ['project8/katydid']
## repo: ['project8/katydid', 'project8/locust_mc', 'project8/mermithid']
# steps:
#
# - name: Repository dispatch
# uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.REPO_ACCESS_TOKEN }}
# repository: ${{ matrix.repo }}
# event-type: release-event