2021-06-09 10:27:33 +00:00
|
|
|
name: Build and push Docker image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: write
|
2021-08-26 16:05:27 +00:00
|
|
|
if: github.repository == 'xSke/PluralKit'
|
2021-06-09 10:27:33 +00:00
|
|
|
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: .
|
2021-06-09 10:27:33 +00:00
|
|
|
push: true
|
|
|
|
tags: |
|
2021-06-09 10:38:47 +00:00
|
|
|
ghcr.io/xske/pluralkit:${{ env.BRANCH_NAME }}
|
|
|
|
ghcr.io/xske/pluralkit:${{ github.sha }}
|
2021-06-09 10:52:33 +00:00
|
|
|
ghcr.io/xske/pluralkit:latest
|
2021-06-09 10:38:47 +00:00
|
|
|
cache-from: type=registry,ref=ghcr.io/xske/pluralkit:${{ env.BRANCH_NAME }}
|
2021-06-09 10:27:33 +00:00
|
|
|
cache-to: type=inline
|
2021-11-28 21:44:13 +00:00
|
|
|
- run: curl https://api-beta.pluralkit.me/v1/update -H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}"
|