name: Build Application
on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?'
- 'v*'
jobs:
build:
runs-on: stable
container:
image: git.euph.dev/actions/runner-java-21:latest
steps:
- name: "Checkout"
uses: "https://git.euph.dev/actions/checkout@v3"
- name: "Install Angular CLI"
run: sudo npm i -g @angular/cli
- name: "Install Dependencies"
run: npm ci
- name: Build Bundle
run: ng build
- name: Upload Binary as Artifact
uses: "https://git.euph.dev/actions/upload-artifact@v3"
with:
name: web
path: dist/tower-defence-companion/browser/*
build-docker:
runs-on: docker
needs:
- build
steps:
- name: "Checkout"
uses: "https://git.euph.dev/actions/checkout@v3"
- name: Download artifact from previous job
uses: "https://git.euph.dev/actions/download-artifact@v3"
with:
name: web
path: .forgejo/workflows/web
- name: Login to Registry
uses: "https://git.euph.dev/actions/docker-login@v3"
with:
registry: git.euph.dev
username: ${{ secrets.DEPLOY_USER }}
password: ${{ secrets.DEPLOY_SECRET }}
- name: Build and push Web Image
uses: "https://git.euph.dev/actions/docker-build-push@v5"
with:
context: ".forgejo/workflows/"
push: true
tags: |
git.euph.dev/towerdefence/web-companion:${{ github.ref_name }}
${{ contains(github.ref_name, 'rc') == false && 'git.euph.dev/towerdefence/web-companion:latest' || '' }}
release:
runs-on: stable
container:
image: git.euph.dev/actions/runner-basic:latest
needs:
- build
- build-docker
steps:
- name: Create Empty Release Asset Dir
run: mkdir -p tmp/this/dir/does/not/exist/yet
- name: Create Release
uses: "https://git.euph.dev/actions/release@v2"
with:
direction: upload
tag: ${{ github.ref_name }}
token: ${{ secrets.DEPLOY_TOKEN }}
prerelease: ${{ contains( github.ref_name, "rc") }}
release-dir: tmp/this/dir/does/not/exist/yet
release-notes: |
# Tower Defence - Companion ${{ github.ref_name }}
Run this release with docker like this:
\`\`\`sh
docker run --rm -p 4300:80 git.euph.dev/towerdefence/web-companion:${{ github.ref_name }}
\`\`\`
It will be available under [\`localhost:4300\`](localhost:4300)
For more information read the [Documentation](https://git.euph.dev/TowerDefence/Dokumentation/wiki/Companion/Config)