-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (52 loc) · 1.84 KB
/
docker-publish.yml
File metadata and controls
61 lines (52 loc) · 1.84 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches: [ main ]
schedule:
- cron: '0 12 5 1,6 *' # 5th day of month, 2 times a year (Jan, Jun) at 12:00 UTC
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Log into registry docker.io
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and publish package
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- run: git config --global user.email "elabutin@mts.ru"
- run: git config --global user.name "Eugene Labutin"
- run: npm ci
- run: npm run release
- run: git push && git push --tags
- name: Get version from package.json
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_ENV
echo "MINOR=$(echo $VERSION | cut -d. -f2)" >> $GITHUB_ENV
echo "PATCH=$(echo $VERSION | cut -d. -f3)" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
push: true
tags: |
mtsrus/logs:latest
mtsrus/logs:${{ env.MAJOR }}
mtsrus/logs:${{ env.MAJOR }}.${{ env.MINOR }}
mtsrus/logs:${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}