-
Notifications
You must be signed in to change notification settings - Fork 75
57 lines (47 loc) · 1.49 KB
/
pre-release.yml
File metadata and controls
57 lines (47 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "Deploy Pre-Release/Dev"
on:
push:
branches:
- '**'
- '!main'
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set tags and NZBDAV_VERSION
id: set_vars
run: |
RAW_REF="${{ github.ref_name }}"
DOCKER_TAG=$(echo "$RAW_REF" \
| tr '[:upper:]' '[:lower:]' \
| sed -E 's#[^a-z0-9._-]+#-#g' \
| sed -E 's#(^-+|-+$)##g')
echo "DOCKER_TAG: $DOCKER_TAG"
echo "NZBDAV_VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT
GHCR_REPO="ghcr.io/${{ github.repository }}"
echo "TAGS=${GHCR_REPO}:${DOCKER_TAG}" >> $GITHUB_OUTPUT
- name: Build and push Docker image (amd64 + arm64)
uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.set_vars.outputs.TAGS }}
build-args: |
NZBDAV_VERSION=${{ steps.set_vars.outputs.NZBDAV_VERSION }}