Skip to content

Normalize spacing in file paths and method calls across tests and Aha… #7

Normalize spacing in file paths and method calls across tests and Aha…

Normalize spacing in file paths and method calls across tests and Aha… #7

Workflow file for this run

name: Docker
on:
push:
branches: [main]
tags: ['v*']
permissions:
contents: write
packages: write
jobs:
build:
name: Build & Push Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/ogmueller/phritzbox
tags: |
type=raw,value=nightly,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
release:
name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build release zip
run: |
mkdir -p phritzbox
cp docker/compose.prod.yaml phritzbox/compose.yaml
cp docker/.env.dist phritzbox/.env.dist
cp docker/console phritzbox/console
chmod +x phritzbox/console
cp docker/INSTALL.md phritzbox/README.md
cp LICENSE phritzbox/
VERSION=${GITHUB_REF_NAME#v}
sed -i "s|ghcr.io/ogmueller/phritzbox:latest|ghcr.io/ogmueller/phritzbox:${VERSION}|" phritzbox/compose.yaml
zip -r phritzbox-${VERSION}.zip phritzbox/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: phritzbox-*.zip