mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(ci): move rust docker target bash to shell script
This commit is contained in:
parent
79f7c973e7
commit
124da02a42
5 changed files with 139 additions and 19 deletions
20
.github/workflows/rust.yml
vendored
20
.github/workflows/rust.yml
vendored
|
|
@ -12,8 +12,8 @@ on:
|
|||
- 'services/gateway/**'
|
||||
- 'services/avatars/**'
|
||||
- '.github/workflows/rust.yml'
|
||||
- 'Dockerfile.rust'
|
||||
- 'Dockerfile.bin'
|
||||
- 'ci/Dockerfile.rust'
|
||||
- 'ci/rust-docker-target.sh'
|
||||
- 'Cargo.toml'
|
||||
- 'Cargo.lock'
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ jobs:
|
|||
with:
|
||||
# https://github.com/docker/build-push-action/issues/378
|
||||
context: .
|
||||
file: Dockerfile.rust
|
||||
file: ci/Dockerfile.rust
|
||||
push: false
|
||||
cache-from: type=registry,ref=ghcr.io/pluralkit/docker-cache:rust
|
||||
cache-to: type=registry,ref=ghcr.io/pluralkit/docker-cache:rust,mode=max
|
||||
|
|
@ -48,13 +48,7 @@ jobs:
|
|||
|
||||
# add more binaries here
|
||||
- run: |
|
||||
for binary in "api" "gateway" "avatars"; do
|
||||
for tag in latest ${{ env.BRANCH_NAME }} ${{ github.sha }}; do
|
||||
cat Dockerfile.bin | sed "s/__BINARY__/$binary/g" | docker build -t ghcr.io/pluralkit/$binary:$tag -f - .
|
||||
done
|
||||
if [ "${{ github.repository }}" == "PluralKit/PluralKit" ]; then
|
||||
docker push ghcr.io/pluralkit/$binary:${{ env.BRANCH_NAME }}
|
||||
docker push ghcr.io/pluralkit/$binary:${{ github.sha }}
|
||||
[ "${{ env.BRANCH_NAME }}" == "main" ] && docker push ghcr.io/pluralkit/$binary:latest
|
||||
fi
|
||||
done
|
||||
tag=${{ github.sha }} \
|
||||
branch=${{ env.BRANCH_NAME }} \
|
||||
push=$([ "${{ github.repository }}" == "PluralKit/PluralKit" ] && echo true || echo false) \
|
||||
ci/rust-docker-target.sh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue