-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.13 KB
/
docker.yml
File metadata and controls
36 lines (34 loc) · 1.13 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
name: Build Docker Image
on:
push:
jobs:
build:
runs-on: 'ubuntu-latest'
name: "Docker"
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get additional build args
id: get_build_args
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
BRANCH_NAME=$(echo "${GITHUB_REF#refs/heads/}" | sed 's/[^a-zA-Z0-9_-]//g')
if [ "$BRANCH_NAME" = "master" ]; then
echo "branch=latest" >> $GITHUB_OUTPUT
else
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
fi
shell: bash
- uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/minerpl/ryneczek:${{ steps.get_build_args.outputs.branch }}
ghcr.io/minerpl/ryneczek:${{ steps.get_build_args.outputs.short_sha }}