Files
webssh/.github/workflows/build-and-publish.yml
T
dido 8ce01cb00a
Build and Push Multi-Arch Docker Image / build (push) Has been cancelled
Initial commit
2026-09-03 11:19:41 +03:00

167 lines
6.5 KiB
YAML

name: Build and Publish WebSSH
on:
push:
tags:
- 'v*'
- 'main'
pull_request:
branches: [ main ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
deployments: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version
id: version
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "version=latest" >> $GITHUB_OUTPUT
echo "tag=latest" >> $GITHUB_OUTPUT
else
VERSION=$(echo "${{ github.ref }}" | sed 's|refs/tags/v||')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$VERSION" >> $GITHUB_OUTPUT
fi
- name: Build and push AMD64
uses: docker/build-push-action@v5
with:
context: .
file: deployment/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-amd64
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-amd64
labels: |
org.opencontainers.image.title=WebSSH
org.opencontainers.image.description=Browser-based SSH client with multi-connection support
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
- name: Build and push ARM64
uses: docker/build-push-action@v5
with:
context: .
file: deployment/Dockerfile
platforms: linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-arm64
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-arm64
labels: |
org.opencontainers.image.title=WebSSH
org.opencontainers.image.description=Browser-based SSH client with multi-connection support
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
- name: Create and push manifest
run: |
# Create and push multi-architecture manifest
docker buildx imagetool create \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} \
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-amd64 \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-arm64
docker buildx imagetool push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
docker buildx imagetool push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Generate release notes
if: startsWith(github.ref, 'refs/tags/')
id: release_notes
run: |
cat << 'EOF' > release_notes.md
## 🚀 WebSSH ${{ steps.version.outputs.version }} Release Notes
### ✨ New Features
- 📚 **Enhanced Help System**: Added comprehensive help documentation with modal interface
- 🎨 **Improved UI**: Wider help modal for better readability
- 🐳 **Multi-Architecture Support**: AMD64 and ARM64 builds
- 🔧 **Configuration**: MAX_UPLOAD_SIZE support with human-readable formats
- 🛡️ **Security**: Enhanced authentication and encryption
### 🐛 Bug Fixes
- Fixed upload size inconsistency issues
- Improved error handling and user feedback
- Enhanced file transfer reliability
### 🏗️ Technical Updates
- Updated to WebSSH v${{ steps.version.outputs.version }}
- Multi-architecture Docker images
- Optimized build process
- Enhanced CI/CD pipeline
### 📋 Installation
```bash
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
docker run -p 8080:8080 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
```
### 🔗 Links
- 📖 [Documentation](https://github.com/${{ github.repository }}/blob/main/help.html)
- 🐳 [Docker Hub](https://github.com/${{ github.repository }}/pkgs/container/${{ env.IMAGE_NAME }})
- 📋 [Releases](https://github.com/${{ github.repository }}/releases)
EOF
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
release_notes.md
body_path: release_notes.md
name: WebSSH ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
draft: false
prerelease: false
- name: Update latest tag
if: startsWith(github.ref, 'refs/tags/')
run: |
# Update latest tag to point to new version
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag -f latest ${{ steps.version.outputs.version }}
git push origin latest --force
- name: Summary
run: |
echo "## 🎉 Build and Publish Complete!"
echo "### 📦 Images Built and Pushed:"
echo "- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} (multi-arch)"
echo "- ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest (multi-arch)"
echo ""
echo "### 🏷️ Architectures:"
echo "- AMD64: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-amd64"
echo "- ARM64: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}-arm64"
echo ""
echo "### 📋 Manifests:"
echo "- Version: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}"
echo "- Latest: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"