73 lines
2.1 KiB
YAML
73 lines
2.1 KiB
YAML
name: Build & Push
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
CHART_PATH: web/charts/factorio-signal-exporter
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Bump version
|
|
id: version
|
|
uses: https://git.sebse.de/sebse/actions/version-bump@v1
|
|
with:
|
|
token: ${{ github.token }}
|
|
|
|
- name: Set env vars
|
|
run: |
|
|
echo "IMAGE=git.sebse.de/${{ github.repository }}" >> $GITHUB_ENV
|
|
echo "IMAGE_MIGRATE=git.sebse.de/${{ github.repository }}-migrate" >> $GITHUB_ENV
|
|
|
|
- name: Docker login
|
|
uses: https://git.sebse.de/sebse/actions/docker-login@v1
|
|
with:
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push app
|
|
uses: https://git.sebse.de/sebse/actions/docker-build-push@v1
|
|
with:
|
|
image: ${{ env.IMAGE }}
|
|
build-context: ./web
|
|
|
|
- name: Build and push migrate
|
|
uses: https://git.sebse.de/sebse/actions/docker-build-push@v1
|
|
with:
|
|
image: ${{ env.IMAGE_MIGRATE }}
|
|
build-context: ./web
|
|
dockerfile: ./web/Dockerfile.migrate
|
|
|
|
- name: Package and push helm chart
|
|
uses: https://git.sebse.de/sebse/actions/helm-package-push@v1
|
|
with:
|
|
chart-path: ${{ env.CHART_PATH }}
|
|
version: ${{ steps.version.outputs.version }}
|
|
app-version: ${{ steps.version.outputs.version }}
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Package and push Factorio mod
|
|
uses: https://git.sebse.de/sebse/actions/factorio-mod-push@v1
|
|
with:
|
|
mod-folder: ./plugin
|
|
version: ${{ steps.version.outputs.version }}
|
|
factorio-token: ${{ secrets.FACTORIO_TOKEN }}
|
|
|
|
- name: Deploy to prod
|
|
uses: https://git.sebse.de/sebse/actions/helm-deploy@v1
|
|
with:
|
|
app: factorio-signal-exporter
|
|
profile: prod
|
|
version: ${{ steps.version.outputs.version }}
|
|
ssh-key: ${{ secrets.HELMBOT_SSH_KEY }}
|