-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1010 Bytes
/
publish-ghcr.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
name: Build and Push Image to GHCR
on:
push:
branches: [main]
jobs:
build:
name: Build and push to GHCR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from VERSION file
id: get-version
run: |
if [ -f VERSION ]; then
VERSION=$(cat VERSION)
else
echo "VERSION file not found. Exiting..."
exit 1
fi
echo "Current version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Login GHCR
run: |
docker login --username Aanttrax --password ${{ secrets.GH_PT }} ghcr.io
- name: Tag Docker and build image with semantic version
run: |
docker build . -t ghcr.io/aanttrax/ms-tasks:${{ steps.get-version.outputs.version }}
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/aanttrax/ms-tasks:${{ steps.get-version.outputs.version }}