Skip to content

Commit af43e80

Browse files
committed
Add GH workflow to build the docker image
1 parent 8a8820d commit af43e80

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
push:
12+
runs-on: ubuntu-latest
13+
if: github.event_name == 'push'
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Build image & push
19+
run: |
20+
echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
21+
22+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
23+
[ "$VERSION" == "master" ] && VERSION=latest
24+
25+
docker build -t ghcr.io/bitprocessor/drone-docker-buildx-ecr:$VERSION .
26+
docker push ghcr.io/bitprocessor/drone-docker-buildx-ecr:$VERSION
27+
if [ "$VERSION" != "latest" ] ; then
28+
docker tag ghcr.io/bitprocessor/drone-docker-buildx-ecr:$VERSION ghcr.io/bitprocessor/drone-docker-buildx-ecr:latest
29+
docker push ghcr.io/bitprocessor/drone-docker-buildx-ecr:latest
30+
fi

0 commit comments

Comments
 (0)