Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workflow to build and push Docker image #16

Merged
merged 3 commits into from
Apr 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
outputs:
DOCKERHUB_USERNAME: ${{ steps.dockerhub_username.outputs.is_set }}
DOCKERHUB_TOKEN: ${{ steps.dockerhub_token.outputs.is_set }}
ALL: ${{ steps.dockerhub_token.outputs.is_set && steps.dockerhub_token.outputs.is_set }}
DOCKER_BASE_REPO: ${{ steps.docker_base_repo.outputs.is_set }}
ALL: ${{ steps.dockerhub_username.outputs.is_set && steps.dockerhub_token.outputs.is_set && steps.docker_base_repo.outputs.is_set }}
bfabio marked this conversation as resolved.
Show resolved Hide resolved
steps:
-
name: Check DOCKERHUB_USERNAME
Expand All @@ -28,6 +29,13 @@ jobs:
run: |
echo "is_set: ${{ secrets.DOCKERHUB_TOKEN != '' }}"
echo "::set-output name=is_set::${{ secrets.DOCKERHUB_TOKEN != '' }}"
-
name: Check DOCKER_BASE_REPO
id: docker_base_repo
run: |
echo "is_set: ${{ secrets.DOCKER_BASE_REPO != '' }}"
echo "::set-output name=is_set::${{ secrets.DOCKER_BASE_REPO != '' }}"

build_and_push:
name: Build and push
runs-on: ubuntu-latest
Expand All @@ -38,18 +46,20 @@ jobs:
name: Checkout
uses: actions/checkout@v2
-
if: ${{ needs.check_secrets.outputs.DOCKERHUB_USERNAME == 'true' }}
if: ${{ needs.check_secrets.outputs.DOCKER_BASE_REPO == 'true' }}
name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/spid-compliant-certificates
${{ secrets.DOCKER_BASE_REPO }}/spid-compliant-certificates
psmiraglia marked this conversation as resolved.
Show resolved Hide resolved
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=edge,branch=main
labels: |
org.opencontainers.image.title=spid-compliant-certificates
-
name: Setup QEMU
uses: docker/setup-qemu-action@v1
Expand Down