Skip to content

Commit

Permalink
Devops: Run Docker workflow only for pushes to origin (#6446)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas authored Jun 5, 2024
1 parent 7de136c commit b1a7141
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
images: ${{ inputs.registry }}/${{ github.repository_owner }}/${{ matrix.target }}
tags: |
type=ref,event=pr
type=ref,event=branch,enable=${{ github.ref_name != 'main' }}
type=edge,enable={{is_default_branch}}
type=raw,value=aiida-${{ env.AIIDA_VERSION }},enable=${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
type=raw,value=python-${{ env.PYTHON_VERSION }},enable=${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: Docker Images

# This workflow needs permissions to publish images to ghcr.io,
# so it does not work for forks. Therefore, we only trigger it
# on pushes to aiidateam/aiida-core repo.
on:
pull_request:
paths-ignore:
- '**.md'
- '**.txt'
- docs/**
- tests/**
push:
branches:
- main
- support/**
- '*'
tags:
- v*
paths-ignore:
Expand All @@ -32,7 +28,7 @@ env:
jobs:
# We build only amd64 first to catch failures faster.
build-amd64:
if: ${{ ! github.event.pull_request.head.repo.fork }}
if: ${{ github.repository == 'aiidateam/aiida-core' }}
uses: ./.github/workflows/docker-build.yml
with:
runsOn: ubuntu-22.04
Expand Down

0 comments on commit b1a7141

Please sign in to comment.