2023-03-27 18:14:19 +00:00
|
|
|
name: Publish
|
2023-03-27 17:36:44 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
2023-03-27 19:23:06 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-03-27 19:23:30 +00:00
|
|
|
arch: ['ubuntu-latest']
|
2023-03-27 19:23:06 +00:00
|
|
|
git-version: ['2.38.4']
|
|
|
|
runs-on: ${{ matrix.arch }}
|
2023-03-27 19:43:26 +00:00
|
|
|
#container: node:19-alpine
|
2023-03-27 17:36:44 +00:00
|
|
|
steps:
|
2023-03-27 19:34:52 +00:00
|
|
|
- name: checkout
|
|
|
|
uses: https://github.com/actions/checkout@v3
|
|
|
|
|
2023-03-27 20:09:48 +00:00
|
|
|
- name: Restore Docker
|
|
|
|
id: cache-docker
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
/usr/bin/docker
|
|
|
|
key: ${{ runner.os }}-docker
|
2023-03-27 20:13:13 +00:00
|
|
|
token: ${{ secrets.GH_TOKEN }}
|
2023-03-27 20:09:48 +00:00
|
|
|
|
|
|
|
- name: Download docker
|
|
|
|
if: steps.cache-docker.outputs.cache-hit != 'true'
|
2023-03-27 19:59:11 +00:00
|
|
|
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/*
|
2023-03-27 19:38:28 +00:00
|
|
|
|
2023-03-27 18:35:37 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
2023-03-27 19:38:28 +00:00
|
|
|
|
2023-03-27 20:05:26 +00:00
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
|
|
|
|
2023-03-27 18:10:34 +00:00
|
|
|
- name: Login to Repo
|
2023-03-27 17:36:44 +00:00
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: git.fascinated.cc
|
|
|
|
username: ${{ secrets.REPO_USERNAME }}
|
|
|
|
password: ${{ secrets.REPO_TOKEN }}
|
2023-03-27 19:38:28 +00:00
|
|
|
|
2023-03-27 18:05:53 +00:00
|
|
|
- name: Build and push
|
2023-03-27 17:36:44 +00:00
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
push: true
|
2023-03-27 19:56:46 +00:00
|
|
|
context: .
|
2023-03-27 19:45:14 +00:00
|
|
|
tags: git.fascinated.cc/fascinated/beatsaber-overlay:latest
|
2023-03-27 20:05:26 +00:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
|
|
|
|
|
|
- name: Move cache
|
|
|
|
run: |
|
|
|
|
rm -rf /tmp/.buildx-cache
|
|
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|