Skip to content

continue fixing errors #203

continue fixing errors

continue fixing errors #203

Workflow file for this run

name: Build app
on: push
jobs:
compile-frontend:
name: Compile frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Build
run: npm run build
working-directory: frontend
- name: Archive binary
uses: actions/upload-artifact@v4
with:
name: frontend
path: frontend/dist/discord-soundboard-bot/**
docker:
name: Build docker image
needs: [ compile-frontend ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download frontend
uses: actions/download-artifact@v4
with:
name: frontend
path: frontend/dist/discord-soundboard-bot/
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/dominikks/discord-soundboard-bot
- name: Set environment variables
if: startsWith(github.ref, 'refs/heads/')
run: |
echo "BUILD_TIMESTAMP=$(git show -s --format=%ct $GITHUB_SHA)" >> $GITHUB_ENV
echo "BUILD_ID=${GITHUB_REF#refs/heads/}#$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_TIMESTAMP
BUILD_ID