runtipi/.github/workflows/release.yml
2023-05-31 08:38:35 +02:00

60 lines
1.7 KiB
YAML

name: Publish release
on:
workflow_dispatch:
jobs:
release:
if: github.repository == 'meienberger/runtipi'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get tag from VERSION file
id: meta
run: |
VERSION=$(npm run version --silent)
TAG=${VERSION}
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Build and push images
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: meienberger/runtipi:latest,meienberger/runtipi:${{ steps.meta.outputs.TAG }}
cache-from: type=registry,ref=meienberger/runtipi:buildcache
cache-to: type=registry,ref=meienberger/runtipi:buildcache,mode=max
- name: Create Tag
id: create_tag
uses: butlerlogic/action-autotag@stable
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_prefix: 'v'
- name: Create Release
id: create_release
uses: actions/create-release@latest
if: steps.create_tag.outputs.tagcreated == 'yes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.tagname }}
release_name: ${{ steps.create_tag.outputs.tagname }}
draft: false
prerelease: false