Files
Sebastian Seedorf 8c83e8b8e8
All checks were successful
Build & Push / build (push) Successful in 3m48s
feat: tag Docker images with semver alongside SHA and latest
2026-06-02 16:15:30 +02:00

99 lines
2.9 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: Extract metadata (app)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=sha,prefix=,format=short
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
- name: Build and push app
uses: docker/build-push-action@v5
with:
context: ./web
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE }}:latest
cache-to: type=inline
- name: Extract metadata (migrate)
id: meta-migrate
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_MIGRATE }}
tags: |
type=sha,prefix=,format=short
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
- name: Build and push migrate
uses: docker/build-push-action@v5
with:
context: ./web
file: ./web/Dockerfile.migrate
push: true
tags: ${{ steps.meta-migrate.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE_MIGRATE }}:latest
cache-to: type=inline
- 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 }}