2023-03-27 18:14:19 +00:00
|
|
|
name: Publish
|
2023-03-27 17:36:44 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-09-25 01:11:32 +00:00
|
|
|
- "main"
|
2023-10-11 22:40:09 +00:00
|
|
|
- "development"
|
2023-03-27 17:36:44 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
2023-10-11 22:19:12 +00:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
container: fascinated/docker-images:node-latest
|
2023-03-27 17:36:44 +00:00
|
|
|
steps:
|
2023-10-11 22:37:41 +00:00
|
|
|
- name: Get branch name
|
|
|
|
id: branch-name
|
|
|
|
uses: tj-actions/branch-names@v7
|
|
|
|
|
2023-03-27 19:34:52 +00:00
|
|
|
- name: checkout
|
2023-10-10 14:30:53 +00:00
|
|
|
uses: actions/checkout@v3
|
2023-03-27 19:34:52 +00:00
|
|
|
|
2023-10-10 14:39:30 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
2023-03-27 18:10:34 +00:00
|
|
|
- name: Login to Repo
|
2023-10-10 14:30:53 +00:00
|
|
|
uses: docker/login-action@v2
|
2023-03-27 17:36:44 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.REPO_USERNAME }}
|
|
|
|
password: ${{ secrets.REPO_TOKEN }}
|
2023-09-25 01:11:32 +00:00
|
|
|
|
2023-10-11 22:37:41 +00:00
|
|
|
- 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)
|
2023-03-27 17:36:44 +00:00
|
|
|
uses: docker/build-push-action@v4
|
2023-10-11 22:37:41 +00:00
|
|
|
if: steps.branch-name.outputs.current_branch == 'master'
|
2023-03-27 17:36:44 +00:00
|
|
|
with:
|
|
|
|
push: true
|
2023-03-27 19:56:46 +00:00
|
|
|
context: .
|
2023-10-08 15:42:08 +00:00
|
|
|
tags: fascinated/beatsaber-overlay:latest
|
2023-10-11 22:37:41 +00:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
|
|
|
|
- name: Build and Push (Other Branches)
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
if: steps.branch-name.outputs.current_branch != 'master'
|
|
|
|
with:
|
|
|
|
push: true
|
|
|
|
context: .
|
|
|
|
tags: fascinated/beatsaber-overlay:${{ steps.branch-name.outputs.current_branch }}
|
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|