Skip to content

Bump docker/setup-qemu-action from 2 to 3 #38

Bump docker/setup-qemu-action from 2 to 3

Bump docker/setup-qemu-action from 2 to 3 #38

Workflow file for this run

name: build
on:
pull_request:
branches: [ main ]
merge_group:
branches: [ main ]
env:
REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=branch,enable=true
type=schedule,enable=false,pattern=nightly
type=ref,event=tag
type=ref,event=pr
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
platforms: linux/amd64, linux/arm64/v8, linux/ppc64le, linux/arm/v6, linux/arm/v7
push: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
singularity:
needs: docker
runs-on: ubuntu-latest
container:
image: quay.io/singularity/singularity:v3.10.4
strategy:
fail-fast: false
matrix:
recipe: ["Singularity"]
steps:
- name: Check out code for the container build
uses: actions/checkout@v3
- name: Continue if Singularity recipe exists
run: |
if [[ -f "${{ matrix.recipe }}" ]]; then
echo "keepgoing=true" >> $GITHUB_ENV
fi
- name: Get branch name
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Build Singularity image
if: ${{ env.keepgoing == 'true' }}
env:
recipe: ${{ matrix.recipe }}
run: |
ls
if [ -f "${{ matrix.recipe }}" ]; then
sudo -E singularity build container.sif ${{ matrix.recipe }}
tag=$(echo "${recipe/Singularity\./}")
if [ "$tag" == "Singularity" ]; then
tag=$BRANCH
fi
# Build the container and name by tag
echo "Tag is $tag."
echo "tag=$tag" >> $GITHUB_ENV
else
echo "${{ matrix.recipe }} is not found."
echo "Present working directory: $PWD"
ls
fi