Skip to content

Commit

Permalink
Merge pull request #1441 from tdonohue/disable_docker_action_on_forks
Browse files Browse the repository at this point in the history
Disable Docker image build action on forked repos & on non-maintenance branches
  • Loading branch information
tdonohue authored Dec 8, 2021
2 parents d955fe7 + a6eecee commit 5b1c928
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# DSpace Docker image build for hub.docker.com
name: Docker images

# Run this Build for all pushes / PRs to current branch
on: [push, pull_request]
# Run this Build for all pushes to 'main' or maintenance branches, or tagged releases.
# Also run for PRs to ensure PR doesn't break Docker build process
on:
push:
branches:
- main
- 'dspace-**'
tags:
- 'dspace-**'
pull_request:

jobs:
docker:
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
if: github.repository == 'dspace/dspace-angular'
runs-on: ubuntu-latest
env:
# Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
Expand All @@ -27,6 +37,7 @@ jobs:
- name: Checkout codebase
uses: actions/checkout@v2

# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1

Expand Down

0 comments on commit 5b1c928

Please sign in to comment.