Skip to content

Commit

Permalink
Do not push Docker images on PR commit (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Feb 6, 2023
1 parent ddd6416 commit 396ddff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/webviz.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: webviz

on:
push:
pull_request:
branches:
- main
Expand All @@ -10,6 +11,7 @@ on:

jobs:
webviz:
if: github.event_name != 'push' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: 📖 Checkout commit locally
Expand All @@ -19,17 +21,21 @@ jobs:
with:
node-version: 18

- name: 🐳 Build Docker images
run: |
docker build -f frontend-prod.Dockerfile -t ghcr.io/equinor/webviz_frontend:latest .
docker build -f backend.Dockerfile -t ghcr.io/equinor/webviz_backend:latest .
- name: GitHub Container Registry login
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🐳 Build and push Docker images
- name: 🐳 Push Docker images
if: github.ref == 'refs/heads/main'
run: |
docker build -f frontend-prod.Dockerfile -t ghcr.io/equinor/webviz_frontend:latest .
docker push ghcr.io/equinor/webviz_frontend:latest
docker build -f backend.Dockerfile -t ghcr.io/equinor/webviz_backend:latest .
docker push ghcr.io/equinor/webviz_backend:latest

0 comments on commit 396ddff

Please sign in to comment.