-
Notifications
You must be signed in to change notification settings - Fork 56
85 lines (70 loc) · 2.59 KB
/
main.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Auto Build
on:
workflow_dispatch:
# inputs:
# tags:
# description: 'Docker Tag'
# required: false
# default: 'latest'
push:
branches: [main,master]
# Only build when files in these directories have been changed
paths:
- containers/**
- template/**
schedule:
- cron: '0 9 * * *' # UTC
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Update Images
run: ./bin/01-update-images ${{ secrets.GITHUB_TOKEN }}
- name: Update Readme
run: ./bin/02-update-readme
- uses: EndBug/add-and-commit@v4 # You can change this to use a specific version
with:
# The name of the user that will be displayed as the author of the commit
# Default: author of the commit that triggered the run
author_name: "bskrtich-ci"
# The email of the user that will be displayed as the author of the commit
# Default: author of the commit that triggered the run
author_email: [email protected]
# Whether to use the --force option on `git add`, in order to bypass eventual gitignores
# Default: false
#force: true
# The message for the commit
# Default: 'Commit from GitHub Actions'
message: 'CI: Autobuild Repo'
env:
# This is necessary in order to push a commit to the repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
- name: Build and Push Images to ghcr.io
run: ./bin/03-build-images push
env:
CI_REGISTRY_IMAGE: ghcr.io/beardedio/terraria
- name: Build and Push Images to docker hub
run: ./bin/03-build-images push
env:
CI_REGISTRY_IMAGE: beardedio/terraria
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASS }}
repository: beardedio/terraria
short-description: "Docker images to run a Terraria Server. Images with TShock Server or Vanilla Server are available."