PluralKit/.github/workflows/docker.yml
Ske dee45d32cf Build Docker images using GitHub Actions
Signed-off-by: Ske <voltasalt@gmail.com>
2021-06-09 12:27:33 +02:00

26 lines
785 B
YAML

name: Build and push Docker image
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
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/}" >> $GITHUB_ENV
- uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}
ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:${{ env.BRANCH_NAME }}
cache-to: type=inline