-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (56 loc) · 1.77 KB
/
Copy pathbuild-docker-container.yaml
File metadata and controls
64 lines (56 loc) · 1.77 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-DOCKER-CONTAINER
run-name: Build container for ${{ github.ref_name }}
on:
workflow_dispatch:
push:
branches:
- master
jobs:
release-docker-container:
runs-on: ubuntu-latest
steps:
- name: CHECK-OUT
uses: actions/checkout@v4
- run: git branch --show-current
- name: CHECK RELEASE or FEATURE
id: release
run: |
if [ "${GITHUB_REF##*/}" == "master" ]; then
echo "RELEASE=true" >> $GITHUB_ENV
else
echo "RELEASE=false" >> $GITHUB_ENV
echo "BUILD_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
fi
- name: EXTRACT VERSION
uses: sergeysova/jq-action@v2
id: version
with:
cmd: "jq .version package.json -r"
- name: LOGIN TO GITHUB DOCKER
uses: docker/login-action@v3
with:
registry: ghcr.io
username: venil7
password: ${{ secrets.GTHB_CR_TOKEN }}
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# builds feature image, pushes under feature tag
- name: BUILD FEATURE DOCKER-IMAGE
if: ${{ env.RELEASE == 'false' }}
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/venil7/assets:${{ env.BUILD_TAG }}
# builds release image, pushes under version and latest tags
- name: BUILD RELEASE DOCKER-IMAGE
if: ${{ env.RELEASE == 'true' }}
uses: docker/build-push-action@v6
with:
# platforms: linux/arm64
push: true
tags: |
ghcr.io/venil7/assets:latest
ghcr.io/venil7/assets:${{ steps.version.outputs.value }}