Skip to content

Display losses in song battles #655

Display losses in song battles

Display losses in song battles #655

Workflow file for this run

name: 'CI'
on: [pull_request]
jobs:
build-image:
runs-on: ubuntu-latest
concurrency:
group: build-or-deploy
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
state: all
- name: Add tag to env
run: echo "TAG=pr-${{ steps.findPr.outputs.pr }}" >> $GITHUB_ENV
- name: Build and push image
uses: docker/build-push-action@v5
with:
push: true
tags: camer0/nico:${{ env.TAG }}
context: .
build-args: |
CRYPT64=${{ secrets.CRYPT64 }}
COMMIT_SHA=${{ github.event.pull_request.head.sha }}
cache-from: type=registry,ref=camer0/nico:buildcache
cache-to: type=registry,ref=camer0/nico:buildcache,mode=min
file: .docker/image.dockerfile
- name: Pull and load image
run: docker pull camer0/nico:${{ env.TAG }}
- name: Run tests
run: |
docker run --rm camer0/nico:${{ env.TAG }} bun test
- name: Rename tag to :latest in Docker Hub
if: contains(github.event.pull_request.labels.*.name, 'deploy')
run: |
docker buildx imagetools create camer0/nico:${{ env.TAG }} --tag camer0/nico:latest
- name: Push to Dokku
if: contains( github.event.pull_request.labels.*.name, 'deploy')
uses: dokku/github-action@master
with:
git_remote_url: ${{ secrets.DOKKU_SSH_URL }}
ssh_private_key: ${{ secrets.DOKKU_SSH_PK }}
git_push_flags: '--force'