update branch name in action
All checks were successful
Publish / docker (push) Successful in 2m58s

This commit is contained in:
Lee 2023-10-11 23:02:02 +00:00
parent 90f39bb409
commit 418ef17b73

@ -1,55 +1,55 @@
name: Publish name: Publish
on: on:
push: push:
branches: branches:
- "main" - "main"
- "development" - "development"
jobs: jobs:
docker: docker:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: fascinated/docker-images:node-latest container: fascinated/docker-images:node-latest
steps: steps:
- name: Get branch name - name: Get branch name
id: branch-name id: branch-name
uses: tj-actions/branch-names@v7 uses: tj-actions/branch-names@v7
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Login to Repo - name: Login to Repo
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
username: ${{ secrets.REPO_USERNAME }} username: ${{ secrets.REPO_USERNAME }}
password: ${{ secrets.REPO_TOKEN }} password: ${{ secrets.REPO_TOKEN }}
- name: Restore Docker Build Cache - name: Restore Docker Build Cache
uses: actions/cache@v3 uses: actions/cache@v3
id: build-cache id: build-cache
with: with:
path: /tmp/.buildx-cache path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx key: ${{ runner.os }}-buildx
- name: Build and Push (Latest) - name: Build and Push (Latest)
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
if: steps.branch-name.outputs.current_branch == 'master' if: steps.branch-name.outputs.current_branch == 'main'
with: with:
push: true push: true
context: . context: .
tags: fascinated/beatsaber-overlay:latest tags: fascinated/beatsaber-overlay:latest
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and Push (Other Branches) - name: Build and Push (Other Branches)
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
if: steps.branch-name.outputs.current_branch != 'master' if: steps.branch-name.outputs.current_branch != 'main'
with: with:
push: true push: true
context: . context: .
tags: fascinated/beatsaber-overlay:${{ steps.branch-name.outputs.current_branch }} tags: fascinated/beatsaber-overlay:${{ steps.branch-name.outputs.current_branch }}
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache