aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2023-05-05 10:53:12 +0100
committerGravatar Chris Lovering <[email protected]>2023-05-05 10:59:18 +0100
commitef0b278755bc23459d8d86977ffabb000e830e7f (patch)
treeb77879c3180899d3040cd6f1794f68b51491db16
parentUse pre-commit hooks in CI (diff)
Always build Dockerfile in CI
Only push to ghcr & deploy if running on default branch
-rw-r--r--.github/workflows/build-deploy.yaml8
-rw-r--r--.github/workflows/main.yaml2
2 files changed, 2 insertions, 8 deletions
diff --git a/.github/workflows/build-deploy.yaml b/.github/workflows/build-deploy.yaml
index 88189b2..8bdc601 100644
--- a/.github/workflows/build-deploy.yaml
+++ b/.github/workflows/build-deploy.yaml
@@ -12,7 +12,6 @@ jobs:
build:
name: Build & Push
runs-on: ubuntu-latest
-
steps:
- name: Checkout code
uses: actions/checkout@v3
@@ -39,9 +38,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v4
with:
- context: .
- file: ./Dockerfile
- push: true
+ push: ${{ github.ref == github.event.repository.default_branch }}
cache-from: type=registry,ref=ghcr.io/python-discord/king-arthur:latest
cache-to: type=inline
tags: |
@@ -54,9 +51,8 @@ jobs:
name: Deploy
runs-on: ubuntu-latest
needs: build
-
+ if: ${{ github.ref == github.event.repository.default_branch }}
steps:
-
- name: Checkout code
uses: actions/checkout@v3
with:
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index fd44690..b476f02 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -12,7 +12,6 @@ concurrency:
jobs:
generate-sha-tag:
- if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
sha-tag: ${{ steps.sha-tag.outputs.sha-tag }}
@@ -27,7 +26,6 @@ jobs:
uses: ./.github/workflows/lint.yaml
build-deploy:
- if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/build-deploy.yaml
needs:
- lint