generated from dpulpeiro/react-typescript-tailwind-eslint-prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (27 loc) · 883 Bytes
/
publish.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
name: publish
on: [push]
jobs:
publish-docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the adacoffeefor.dev Docker image
env:
IMAGE: ghcr.io/dpulpeiro/adacoffeefor.dev
run: |
export TAG=$(git log -1 --format=%h --quiet | awk -F@ '{print $1}')
export DOCKER_IMAGE="$IMAGE:$TAG"
DOCKER_BUILDKIT=1 docker build \
-f devops/prod/Dockerfile \
-t ${DOCKER_IMAGE} \
. && \
echo "build finished" && \
docker push $DOCKER_IMAGE && \
git tag "release/$TAG" && \
git push origin --tags