Files
Control-Center/.gitea/workflows/dev.yml
Joshua King 8fb4183abe
Some checks failed
Dev Build & Deploy / test-and-build (push) Failing after 7s
Dev Build & Deploy / docker-build-push (push) Has been skipped
Add container spec to fix /var/run symlink path escape error
2026-05-20 08:30:49 -04:00

88 lines
2.3 KiB
YAML

name: Dev Build & Deploy
on:
pull_request:
branches: [dev]
push:
branches: [dev]
env:
REGISTRY: code.cubecraftcreations.com
BACKEND_IMAGE: ${{ gitea.repository }}/backend
FRONTEND_IMAGE: ${{ gitea.repository }}/frontend
jobs:
test-and-build:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
run: |
curl -sL https://go.dev/dl/go1.23.6.linux-amd64.tar.gz | tar -C /usr/local -xz
echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Run backend tests
run: go test ./...
working-directory: ./go-backend
- name: Build backend
run: go build -ldflags="-w -s" -o /tmp/server ./cmd/server
working-directory: ./go-backend
- name: Setup Node
run: |
curl -sL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs
- name: Install frontend deps
run: npm ci
working-directory: ./frontend
- name: Lint frontend
run: npm run lint
working-directory: ./frontend
- name: Build frontend
run: npm run build
working-directory: ./frontend
docker-build-push:
needs: test-and-build
if: gitea.event_name == 'push'
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build & push backend image
uses: docker/build-push-action@v6
with:
context: ./go-backend
push: true
tags: |
${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE }}:dev
${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE }}:${{ gitea.sha }}
- name: Build & push frontend image
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
tags: |
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE }}:dev
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE }}:${{ gitea.sha }}