-
Notifications
You must be signed in to change notification settings - Fork 37
41 lines (32 loc) · 1.26 KB
/
build-app.yml
File metadata and controls
41 lines (32 loc) · 1.26 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
name: build and publish docker image
on:
workflow_call:
secrets:
dockerhub_token:
required: false
jobs:
build-docker-image:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: generate version.env
run: ./scripts/version
- name: output version variables to github output
id: get_version
run: sed 's/export //g' version.env | awk '{ print tolower($1) }' | tee -a $GITHUB_OUTPUT
- uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.dockerhub_token }}
if: github.ref_name == 'main' || (github.event_name == 'release' && github.event.action == 'published')
- name: build and push docker image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.ref_name == 'main' || (github.event_name == 'release' && github.event.action == 'published') }}
file: package/Dockerfile
tags: ${{ vars.IMAGE_REF }}:${{ steps.get_version.outputs.image_version }}
build-args: |
version=${{ steps.get_version.outputs.version }}