PluralKit/.github/workflows/docker.yml

36 lines
1.2 KiB
YAML
Raw Normal View History

name: Build and push Docker image
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
if: github.repository == 'xSke/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/}" >> $GITHUB_ENV
- uses: docker/build-push-action@v2
with:
2021-08-01 19:32:58 +00:00
# https://github.com/docker/build-push-action/issues/378
context: .
push: true
tags: |
ghcr.io/xske/pluralkit:${{ env.BRANCH_NAME }}
ghcr.io/xske/pluralkit:${{ github.sha }}
ghcr.io/xske/pluralkit:latest
cache-from: type=registry,ref=ghcr.io/xske/pluralkit:${{ env.BRANCH_NAME }}
cache-to: type=inline
- name: "Update Beta Bot"
if: contains(github.ref, "main")
uses: fjogeleit/http-request-action@master
with:
url: https://api-beta.pluralkit.me/v1/update
bearerToken: ${{ secrets.WATCHTOWER_TOKEN }}