File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ RELEASE=notification-server
2+ VERSION=1
3+ BUILD=1
4+ FIX=1
5+
Original file line number Diff line number Diff line change 1+ name : Build and publish notification
2+
3+ on :
4+ push :
5+ branches :
6+ - wip
7+ paths :
8+ - ' .env.notification'
9+
10+ jobs :
11+ PackageDeploy :
12+ runs-on : ubuntu-22.04
13+
14+ steps :
15+ - uses : actions/checkout@v2
16+
17+ - name : Docker Setup BuildX
18+ uses : docker/setup-buildx-action@v2
19+
20+ - name : Load environment variables and set them
21+ run : |
22+ if [ -f .env.notification ]; then
23+ export $(cat .env.notification | grep -v '^#' | xargs)
24+ fi
25+ echo "RELEASE=$RELEASE" >> $GITHUB_ENV
26+ echo "VERSION=$VERSION" >> $GITHUB_ENV
27+ echo "BUILD=$BUILD" >> $GITHUB_ENV
28+ echo "FIX=$FIX" >> $GITHUB_ENV
29+ - name : Set repo
30+ run : |
31+ LOWER_CASE_GITHUB_REPOSITORY=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')
32+ echo "DOCKER_TAG_CUSTOM=ghcr.io/${LOWER_CASE_GITHUB_REPOSITORY}:$RELEASE-$VERSION.$BUILD.$FIX" >> $GITHUB_ENV
33+ echo "$GITHUB_ENV"
34+ - name : Docker Build
35+ run : |
36+ cd notification-server && docker image build --tag $DOCKER_TAG_CUSTOM -f Dockerfile .
37+
38+ - name : Log in to GitHub container registry
39+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
40+
41+ - name : Push Docker image to ghcr
42+ run : docker push $DOCKER_TAG_CUSTOM
You can’t perform that action at this time.
0 commit comments