Skip to content

Commit

Permalink
Merge pull request #21 from zazuko/no-push-by-default
Browse files Browse the repository at this point in the history
No need to build and push the Docker images on each PR and commit
  • Loading branch information
ludovicm67 authored Apr 23, 2024
2 parents bb4e63d + c876fe8 commit 661490d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yaml → .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: Build and push Docker image

on:
push:
branches:
- "**"
tags:
- "v*.*.*"

jobs:
docker:
runs-on: ubuntu-latest

env:
DOCKER_IMAGE: ghcr.io/zazuko/varnish-post

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -21,9 +22,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run tests
run: cd test && ./run.sh && cd ..

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -32,10 +30,16 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
uses: zazuko/action-docker-meta@main
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/zazuko/varnish-post
images: "${{ env.DOCKER_IMAGE }}"
tags: |
type=ref,event=branch
type=semver,prefix=v,pattern={{version}}
type=semver,prefix=v,pattern={{major}}.{{minor}}
type=semver,prefix=v,pattern={{major}}
type=sha
- name: Build and push Docker images
id: docker_build
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run tests

on:
push:
branches:
- "**"

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run tests
run: cd test && ./run.sh && cd ..

0 comments on commit 661490d

Please sign in to comment.