-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (41 loc) · 1.13 KB
/
push-app-image.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
38
39
40
41
42
43
44
45
46
47
name: Push app image
on:
# This runs on v *.*.0 after the base image has been
# built and pushed, or on patch version tag.
push:
tags:
- "v*.*.[1-9]*"
workflow_run:
workflows:
- "Push base image"
types:
- "completed"
env:
DOCKER_USER: lcnetdev
DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
REPO_NAME: scriptshifter
jobs:
push-image-to-docker-hub:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: update version info
run: |
git fetch --tags
git describe --tags --always >| VERSION
git rev-parse HEAD >> VERSION
- name: Build the Docker image
run: >
docker build -f Dockerfile .
--tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
--tag $DOCKER_USER/$REPO_NAME:latest
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: lcnetdev
password: ${{ secrets.DOCKER_HUB }}
- name: Push to Docker Hub
run: docker push $DOCKER_USER/$REPO_NAME --all-tags