feat(ci): build docker images on all branches
This commit is contained in:
parent
1b95740c86
commit
c69ab99519
21
.github/workflows/docker.yml
vendored
21
.github/workflows/docker.yml
vendored
@ -1,7 +1,6 @@
|
|||||||
name: Build and push Docker image
|
name: Build and push Docker image
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
|
||||||
paths:
|
paths:
|
||||||
- 'Myriad/**'
|
- 'Myriad/**'
|
||||||
- 'PluralKit.API/**'
|
- 'PluralKit.API/**'
|
||||||
@ -21,15 +20,25 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.CR_PAT }}
|
password: ${{ secrets.CR_PAT }}
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
|
- 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
|
- uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
# https://github.com/docker/build-push-action/issues/378
|
# https://github.com/docker/build-push-action/issues/378
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
ghcr.io/pluralkit/pluralkit:${{ env.BRANCH_NAME }}
|
|
||||||
ghcr.io/pluralkit/pluralkit:${{ github.sha }}
|
|
||||||
ghcr.io/pluralkit/pluralkit:latest
|
|
||||||
cache-from: type=registry,ref=ghcr.io/pluralkit/pluralkit:${{ env.BRANCH_NAME }}
|
cache-from: type=registry,ref=ghcr.io/pluralkit/pluralkit:${{ env.BRANCH_NAME }}
|
||||||
cache-to: type=inline
|
cache-to: type=inline
|
||||||
|
Loading…
Reference in New Issue
Block a user