Fix (docker): Use 127.0.0.1 instead of localhost to test snappymail in entrypoint.sh (#1325)

* Fix (docker): Use `127.0.0.1` instead of `localhost` to test snappymail in `entrypoint.sh`

* Run build on PR but don't push

* Login only on tags

* Fix test
This commit is contained in:
leo 2023-11-22 23:36:36 +00:00 committed by GitHub
parent 60964c9869
commit 60700a56e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 9 deletions

View file

@ -3,7 +3,10 @@ name: docker
on:
push:
tags:
- 'v2.*'
- '**'
pull_request:
branches:
- master
# This is needed to push to GitHub Container Registry. See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
permissions:
@ -28,9 +31,11 @@ jobs:
images: |
djmaze/snappymail
ghcr.io/${{ github.repository }}
# type=ref,event=pr generates tag(s) on PRs only. E.g. 'pr-123', 'pr-123-abc0123'
# type=ref,event=branch generates tag(s) on branch only. E.g. 'master', 'master-abc0123'
# type=ref,event=tag generates tag(s) on tags only. E.g. 'v0.0.0', 'v0.0.0-abc0123', and 'latest'
tags: |
type=ref,event=pr
type=ref,suffix=-{{sha}},event=pr
type=ref,event=branch
type=ref,event=tag
@ -56,12 +61,14 @@ jobs:
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
if: startsWith(github.ref, 'refs/tags/') # Login only on tags
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/') # Login only on tags
uses: docker/login-action@v2
with:
registry: ghcr.io
@ -101,7 +108,7 @@ jobs:
# TODO: Add more arches?
# platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x
platforms: linux/386,linux/amd64
push: true
push: startsWith(github.ref, 'refs/tags/') # Push only on tags
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache