add windows native titlebar tweak #3 #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Docker Image | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
jobs: | |
publish: | |
name: Publish Docker Image to ghcr.io | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Extract version number | |
run: | | |
VERSION=$(grep -oP -m 1 '(?<=^## r)\d+' CHANGELOG.md) | |
if [[ $VERSION = "" ]]; then | |
echo "No version found in CHANGELOG.md" | |
exit 1 | |
fi | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Create Docker Image tags | |
run: | | |
TAGS="ghcr.io/${{ github.repository }}:dev" | |
if docker manifest inspect ghcr.io/${{ github.repository }}:0.0.$VERSION > /dev/null 2>&1; then | |
echo "Image with version (0.0.$VERSION) already exists in registry" | |
echo "Publishing a dev image.." | |
else | |
echo "Image with version (0.0.$VERSION) does not exist in the registry yet" | |
echo "Publishing a release and a dev image.." | |
echo "IS_RELEASE=true" >> $GITHUB_ENV | |
TAGS="${TAGS},\ | |
ghcr.io/${{ github.repository }}:0.0.${{ env.VERSION }},\ | |
ghcr.io/${{ github.repository }}:latest" | |
fi | |
echo "TAGS=${TAGS}" >> $GITHUB_ENV | |
- name: Log in to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ${{ env.TAGS }} | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Update release container on server | |
if: env.IS_RELEASE == 'true' | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USER }} | |
key: ${{ secrets.DEPLOY_PRIVKEY }} | |
# this relies on a specific custom update script that is installed on the | |
# server that currently hosts sheltupdate. Adjust as needed. | |
script: ~/update.sh sheltupdate | |
- name: Update staging container on server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USER }} | |
key: ${{ secrets.DEPLOY_PRIVKEY }} | |
script: ~/update.sh sheltupdate-staging |