mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 14:57:54 +00:00
chore: clean up github actions workflows
This commit is contained in:
parent
089cc9750f
commit
ba81191312
7 changed files with 79 additions and 101 deletions
47
.github/workflows/dotnet-docker.yml
vendored
Normal file
47
.github/workflows/dotnet-docker.yml
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
name: Build and push Docker image
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/docker.yml'
|
||||
- 'ci/dotnet-version.sh'
|
||||
- 'Myriad/**'
|
||||
- 'PluralKit.API/**'
|
||||
- 'PluralKit.Bot/**'
|
||||
- 'PluralKit.Core/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: '.net docker build'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
if: github.repository == 'PluralKit/PluralKit'
|
||||
steps:
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.CR_PAT }}
|
||||
- uses: actions/checkout@v2
|
||||
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" | sed 's|/|-|g' >> $GITHUB_ENV
|
||||
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=raw,value=${{ env.BRANCH_NAME }}
|
||||
type=raw,value=${{ github.sha }}
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
flavor: |
|
||||
latest=false
|
||||
|
||||
- uses: docker/build-push-action@v2
|
||||
with:
|
||||
# https://github.com/docker/build-push-action/issues/378
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=registry,ref=ghcr.io/pluralkit/pluralkit:${{ env.BRANCH_NAME }}
|
||||
cache-to: type=inline
|
||||
Loading…
Add table
Add a link
Reference in a new issue