-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (54 loc) · 1.64 KB
/
stable-docker.yaml
File metadata and controls
64 lines (54 loc) · 1.64 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
58
59
60
61
62
63
64
name: Release Stable Docker Image
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: write
packages: write
env:
CARGO_TERM_COLOR: always
jobs:
app_version:
name: Get App Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from Cargo.toml
id: get_version
run: |
version=$(grep '^version' Cargo.toml | head -n1 | sed -E 's/version = "(.*)"/\1/')
echo "version=$version" >> $GITHUB_OUTPUT
build_docker:
name: Build Docker Multi-Platform and Export Linux Binary
runs-on: ubuntu-latest
needs: app_version
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile.cross.gnu
platforms: linux/amd64,linux/arm64
build-args: |
PHLOW_VERSION=${{ needs.app_version.outputs.version }}
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/phlow:latest
ghcr.io/${{ github.repository_owner }}/phlow:${{ needs.app_version.outputs.version }}