Skip to content

Modernize workflow output handling #3

Modernize workflow output handling

Modernize workflow output handling #3

Workflow file for this run

name: Deploy Mod Installer
on:
push:
branches:
- main
workflow_dispatch:
repository_dispatch:
types:
- deploy
jobs:
check-secrets:
runs-on: ubuntu-latest
outputs:
HAS_SECRETS: ${{ steps.check.outputs.HAS_SECRETS }}
steps:
- id: check
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |-
echo 'HAS_SECRETS=${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_PASSWORD != '' }}' >> $GITHUB_OUTPUT
deploy:
name: Build and deploy
needs: check-secrets
if: needs.check-secrets.outputs.HAS_SECRETS == 'true'
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build ModInstaller image
uses: docker/build-push-action@v5
with:
tags: kspckan/mod-installer
outputs: type=registry