forked from buerokratt/Buerokratt-Chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.26 KB
/
ci-build-image.yml
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
name: Build and publish GUI with nginx
on:
push:
branches:
- v2.0.1
paths:
- '.env.test'
jobs:
PackageDeploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Docker Setup BuildX
uses: docker/setup-buildx-action@v2
- name: Load environment variables and set them
run: |
if [ -f .env.test ]; then
export $(cat .env.test | grep -v '^#' | xargs)
fi
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "BUILD=$BUILD" >> $GITHUB_ENV
echo "FIX=$FIX" >> $GITHUB_ENV
- name: Set repo
run: |
LOWER_CASE_GITHUB_REPOSITORY=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')
echo "DOCKER_TAG_CUSTOM=ghcr.io/${LOWER_CASE_GITHUB_REPOSITORY}:$RELEASE-$VERSION.$BUILD.$FIX" >> $GITHUB_ENV
echo "$GITHUB_ENV"
- name: Docker Build
run: |
cd GUI
docker image build --tag $DOCKER_TAG_CUSTOM --no-cache .
- name: Log in to GitHub container registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push Docker image to ghcr
run: docker push $DOCKER_TAG_CUSTOM