-
Notifications
You must be signed in to change notification settings - Fork 12
65 lines (57 loc) · 2.29 KB
/
alpine-node.yml
File metadata and controls
65 lines (57 loc) · 2.29 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
62
63
64
65
name: Build docker images
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
push:
branches:
- master
paths:
- packages/alpine-node-nginx/**
jobs:
build:
strategy:
matrix:
versions: [
{ node: '20.20.0', alpine: '3.23', image: node, dockerfile: Dockerfile, tag: '20.20.0' },
{ node: '22.22.0', alpine: '3.23', image: node, dockerfile: Dockerfile, tag: '22.22.0' },
{ node: '24.14.1', alpine: '3.23', image: node, dockerfile: Dockerfile, tag: '24.14.1' },
{ node: '20.20.0', alpine: '3.23', image: node, dockerfile: Dockerfile-slim, tag: '20.20.0-slim' },
{ node: '22.22.0', alpine: '3.23', image: node, dockerfile: Dockerfile-slim, tag: '22.22.0-slim' },
{ node: '24.14.1', alpine: '3.23', image: node, dockerfile: Dockerfile-slim, tag: '24.14.1-slim' },
]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get git short SHA
id: git_info
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "is_master=${{ github.ref_name == 'master' }}" >> $GITHUB_OUTPUT
- name: Determine tag
id: tag_info
run: |
if [ "${{ steps.git_info.outputs.is_master }}" = "true" ]; then
echo "final_tag=${{ matrix.versions.tag }}" >> $GITHUB_OUTPUT
else
echo "final_tag=${{ matrix.versions.tag }}-${{ steps.git_info.outputs.short_sha }}" >> $GITHUB_OUTPUT
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: packages/alpine-node-nginx/
file: packages/alpine-node-nginx/${{ matrix.versions.dockerfile }}
push: true
build-args: |
NODE_VERSION=${{ matrix.versions.node }}
ALPINE_VERSION=${{ matrix.versions.alpine }}
NODE_BASE_IMAGE=${{ matrix.versions.image }}
tags: alfabankui/arui-scripts:${{ steps.tag_info.outputs.final_tag }}