2022-04-19 20:19:31 +00:00
|
|
|
name: Build gateway Docker image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
paths:
|
2022-06-05 17:50:52 +00:00
|
|
|
- 'gateway/**'
|
|
|
|
- 'proto/**'
|
2022-04-19 20:19:31 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
packages: write
|
2022-06-05 16:57:10 +00:00
|
|
|
if: github.repository == 'PluralKit/PluralKit'
|
2022-04-19 20:19:31 +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:
|
|
|
|
# https://github.com/docker/build-push-action/issues/378
|
|
|
|
context: .
|
2022-07-05 19:37:15 +00:00
|
|
|
file: gateway/Dockerfile
|
2022-04-19 20:19:31 +00:00
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
ghcr.io/pluralkit/gateway:${{ env.BRANCH_NAME }}
|
|
|
|
ghcr.io/pluralkit/gateway:${{ github.sha }}
|
|
|
|
ghcr.io/pluralkit/gateway:latest
|
|
|
|
cache-from: type=registry,ref=ghcr.io/pluralkit/gateway:${{ env.BRANCH_NAME }}
|
|
|
|
cache-to: type=inline
|