Auto Build #1558
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |