-
Notifications
You must be signed in to change notification settings - Fork 2
37 lines (33 loc) · 1.11 KB
/
dockerimage.yml
File metadata and controls
37 lines (33 loc) · 1.11 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
name: Docker Image CI
on:
push:
branches:
- master
env:
REGISTRY: docker-hosted-nexus.finods.com/evryfs/
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
with:
fetch-depth: '0'
- id: tagName
run: echo ::set-output name=tag_name::$(head -1 Dockerfile | awk '{print $2}' | tr ':' ' '| awk '{print $2}')
- uses: anothrNick/github-tag-action@1.55.0
env:
CUSTOM_TAG: ${{ steps.tagName.outputs.tag_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-to-repo:
name: Publish artifacts to Nexus
runs-on: [ self-hosted, linux, finods-global ]
needs: build
steps:
- name: checkout
uses: actions/checkout@v4.1.7
- name: Build Docker Image / push to Nexus
if: github.ref == 'refs/heads/develop'
run: |
docker build . -t ${{env.REGISTRY}}:apache-php-web:8.2.20-apache
docker login -u ${{ secrets.DTS_JENKINS_IS_USER }} -p ${{ secrets.DTS_JENKINS_IS_PASSWORD }} docker-hosted-nexus.finods.com
docker push ${{env.REGISTRY}}:apache-php-web:8.2.20-apache