Skip to content

Commit

Permalink
add docker build/no-push action
Browse files Browse the repository at this point in the history
  • Loading branch information
espenhgn committed Aug 22, 2024
1 parent 5038be2 commit ffdd655
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# action to build the Docker image at each commit without pushing it
name: build Docker image

on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'
tags:
- "v*.*.*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/mesocircuit_model
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:docker"
push: False
tags: ${{ steps.meta.outputs.tags }}
file:
./Dockerfile
platforms:
linux/amd64
linux/arm64

0 comments on commit ffdd655

Please sign in to comment.