Merge pull request #420 from damongolding/task/release #9
Workflow file for this run
This file contains hidden or 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: GHCR Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Extract version from tag | |
id: extract_version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
VERSION=${VERSION#v} | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Build and push Docker image | |
run: | | |
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/immich-kiosk | |
docker buildx build --build-arg VERSION=${{ env.VERSION }} \ | |
--platform linux/amd64,linux/arm64 \ | |
--push -t $IMAGE_NAME:${{ env.VERSION }} \ | |
-t $IMAGE_NAME:latest . | |
- name: Construct release URL | |
run: | | |
REPO_OWNER=$(echo ${{ github.repository }} | cut -d '/' -f 1) | |
REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2) | |
RELEASE_URL="https://github.com/$REPO_OWNER/$REPO_NAME/releases/tag/v${{ env.VERSION }}" | |
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV | |
- name: Discord Notification | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: "Immich Kiosk ${{ env.VERSION }} has been released! Check it out: ${{ env.RELEASE_URL }}" | |
trigger: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.PAT_TOKEN }} | |
script: | | |
await github.rest.repos.createDispatchEvent({ | |
owner: 'damongolding', | |
repo: 'immich-kiosk-unraid', | |
event_type: 'generate-xml', | |
}); |