-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 969 Bytes
/
nodejs-docker.yml
File metadata and controls
36 lines (31 loc) · 969 Bytes
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
name: Build nodejs-docker
on:
push:
branches:
- master
paths:
- 'nodejs-docker/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Extract Tag from Dockerfile
id: version
run: |
BASE_IMAGE=$(grep '^FROM' nodejs-docker/Dockerfile | awk '{print $2}')
TAG=$(echo "$BASE_IMAGE" | cut -d':' -f2)
echo "Base image: $BASE_IMAGE"
echo "Extracted tag: $TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Build & Push to Docker Hub
uses: opspresso/action-docker@master
env:
USERNAME: ${{ secrets.DOCKER_USERNAME }}
PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
BUILD_PATH: "nodejs-docker/"
DOCKERFILE: "nodejs-docker/Dockerfile"
IMAGE_NAME: "vparanoiaque/nodejs-docker"
TAG_NAME: ${{ steps.version.outputs.tag }}
LATEST: "true"