Skip to content

Commit

Permalink
dont push container image for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed May 22, 2022
1 parent 8e9ab00 commit b8f0e5c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
run: pip install -e .[dev]

- name: Run tests
run: pytest tests
run: pytest tests

- name: Create requirements_dev.txt
run: |
Expand Down Expand Up @@ -180,6 +180,7 @@ jobs:
${{ runner.os }}-buildx-
- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
Expand All @@ -191,12 +192,10 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
# all pull requests share a single tag 'pr'
tags: |
type=ref,event=branch
type=ref,event=tag
type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }}
type=raw,value=pr
type=raw,value=latest
- name: Set up Docker Buildx
id: buildx
Expand All @@ -207,7 +206,7 @@ jobs:
with:
file: .devcontainer/Dockerfile
context: .
push: true
push: ${{ github.event_name != 'pull_request' }}
build-args: BASE=python:3.10-slim
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down

0 comments on commit b8f0e5c

Please sign in to comment.