Update build-push.yml

Use GitHub's provided vars to avoid headaches for everyone™
main
Tyrone Faulhaber 2023-09-25 17:30:23 +02:00 committed by GitHub
parent 1d413aff89
commit 35ca9603e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

View File

@ -8,15 +8,14 @@ on:
branches: [ "main", "dev" ]
workflow_dispatch:
permissions:
packages: write
contents: read
jobs:
build-and-push:
name: Build Docker image and push to registry
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3
@ -39,7 +38,7 @@ jobs:
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/kankerdev/spoticord/bot
ghcr.io/${{ github.repository }}
# Docker tags based on the following events/attributes
tags: |
type=raw,value=latest,enable={{is_default_branch}}
@ -59,5 +58,5 @@ jobs:
tags: ${{ steps.spoticord.outputs.tags }}
labels: ${{ steps.spoticord.outputs.labels }}
# Some basic caching of the layers...
cache-from: ghcr.io/kankerdev/spoticord/bot:latest-cache
cache-to: ghcr.io/kankerdev/spoticord/bot:latest-cache
cache-from: ghcr.io/${{ github.repository }}:latest-cache
cache-to: ghcr.io/${{ github.repository }}:latest-cache