This repository has been archived on 2023-11-06. You can view files and clone it, but cannot push or open issues or pull requests.
beatsaber-overlay/.gitea/workflows/publish.yaml
2023-10-15 23:21:40 +00:00

59 lines
1.5 KiB
YAML

name: Publish
on:
push:
branches:
- "main"
- "development"
jobs:
docker:
runs-on: ubuntu-22.04
container: fascinated/docker-images:node-latest
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: checkout
uses: actions/checkout@v4
- 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: Restore Docker Build Cache
uses: actions/cache@v3
id: build-cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
- name: Build and Push (Latest)
uses: docker/build-push-action@v5
if: steps.branch-name.outputs.current_branch == 'main'
with:
push: true
context: .
tags: fascinated/beatsaber-overlay:latest
- name: Build and Push (Other Branches)
uses: docker/build-push-action@v5
if: steps.branch-name.outputs.current_branch != 'main'
with:
push: true
context: .
tags: fascinated/beatsaber-overlay:${{ steps.branch-name.outputs.current_branch }}
- name: Save Docker Build Cache
id: build-cache
uses: actions/cache/save@v3
with:
path: /tmp/.buildx-caches
key: ${{ runner.os }}-buildx