59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Build & Push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
IMAGE: git.sebse.de/${{ github.repository }}
|
|
IMAGE_MIGRATE: git.sebse.de/${{ github.repository }}-migrate
|
|
CHART_PATH: web/charts/factorio-signal-exporter
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set SHORT_SHA
|
|
run: echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
|
|
|
|
- name: Docker login
|
|
uses: sebse/actions/docker-login@main
|
|
with:
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and push app
|
|
uses: sebse/actions/docker-build-push@main
|
|
with:
|
|
image: ${{ env.IMAGE }}
|
|
context: ./web
|
|
|
|
- name: Build and push migrate
|
|
uses: sebse/actions/docker-build-push@main
|
|
with:
|
|
image: ${{ env.IMAGE_MIGRATE }}
|
|
context: ./web
|
|
dockerfile: ./web/Dockerfile.migrate
|
|
|
|
- name: Package and push helm chart
|
|
uses: sebse/actions/helm-package-push@main
|
|
with:
|
|
chart-path: ${{ env.CHART_PATH }}
|
|
version: 0.0.0-${{ env.SHORT_SHA }}
|
|
app-version: ${{ env.SHORT_SHA }}
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Deploy to prod
|
|
uses: sebse/actions/helm-deploy@main
|
|
with:
|
|
app: factorio-signal-exporter
|
|
profile: prod
|
|
version: 0.0.0-${{ env.SHORT_SHA }}
|
|
ssh-key: ${{ secrets.HELMBOT_SSH_KEY }}
|