Skip to content

Commit

Permalink
Login on pull_request
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Dec 12, 2023
1 parent c90677b commit b57bc12
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: docker
on:
push:
# TODO: Build on main?
# Build on main
branches:
- main
tags:
Expand Down Expand Up @@ -103,14 +103,12 @@ jobs:
${{ runner.os }}-buildx-
- name: Login to Docker Hub registry
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') # Login only on master and tags
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') # Login only on master and tags
uses: docker/login-action@v2
with:
registry: ghcr.io
Expand All @@ -135,7 +133,7 @@ jobs:
context: '.'
file: Dockerfile
platforms: linux/amd64,linux/arm,linux/arm64,linux/mips64le,linux/ppc64le,linux/riscv64,linux/s390x
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }} # Push only on master and tags
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down

0 comments on commit b57bc12

Please sign in to comment.