2024-01-03 07:25:17 +00:00
|
|
|
name: Publish Docker Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "master"
|
2024-01-03 10:39:14 +00:00
|
|
|
paths-ignore: # Files in here will not trigger a build
|
|
|
|
- "README.md"
|
|
|
|
- "LICENSE"
|
|
|
|
- "grafana-dashboard.json"
|
|
|
|
- "storage-tracker.sh"
|
|
|
|
- "useful-stuff.md"
|
2024-01-06 05:13:53 +00:00
|
|
|
- ".gitea/workflows/ci.yml"
|
2024-01-03 07:25:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
2024-09-26 06:04:04 +00:00
|
|
|
runs-on: ubuntu-24.04
|
2024-01-03 07:25:17 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Restore Docker Cache
|
2024-01-17 17:01:29 +00:00
|
|
|
uses: actions/cache@v4
|
2024-01-03 07:25:17 +00:00
|
|
|
id: docker-cache
|
|
|
|
with:
|
|
|
|
path: /usr/bin/docker
|
|
|
|
key: ${{ runner.os }}-docker
|
|
|
|
|
|
|
|
- name: Install Docker (if not cached)
|
|
|
|
if: steps.docker-cache.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
|
|
|
wget -q -O /tmp/docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-20.10.23.tgz \
|
|
|
|
&& tar --extract --file /tmp/docker.tgz --directory /usr/bin --strip-components 1 --no-same-owner docker/docker \
|
|
|
|
&& rm -rf /tmp/* &&
|
|
|
|
echo "Done"
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Login to Repo
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.REPO_USERNAME }}
|
|
|
|
password: ${{ secrets.REPO_TOKEN }}
|
|
|
|
|
|
|
|
- name: Build and Push (Latest)
|
2024-08-10 11:33:00 +00:00
|
|
|
uses: docker/build-push-action@v6
|
2024-01-03 07:25:17 +00:00
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
context: .
|
2024-01-03 08:34:40 +00:00
|
|
|
tags: fascinated/mc-tracker:latest
|
2024-01-03 07:25:17 +00:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|