-
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (41 loc) · 1.17 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deploy Mod Installer
on:
push:
branches:
- main
workflow_dispatch:
repository_dispatch:
types:
- deploy
schedule:
- cron: '53 23 * * *'
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