-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.32 KB
/
docker-image.yml
File metadata and controls
35 lines (30 loc) · 1.32 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
name: Docker Image CI
on:
push:
branches: [ master ]
jobs:
build:
name: Build docker and deploy on DockerHub and Techsytes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker login on DockerHub
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run:
docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}
- name: Docker login on techsytes
env:
TECHSYTES_USER: ${{secrets.TECHSYTES_USER}}
TECHSYTES_PASSWORD: ${{secrets.TECHSYTES_PASSWORD}}
run: |
docker login registry.techsytes.com -u ${TECHSYTES_USER} -p ${TECHSYTES_PASSWORD}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag techmago/docker-ftpython:master-${GITHUB_RUN_NUMBER} --tag techmago/docker-ftpython:latest --tag registry.techsytes.com/docker-ftpython:master-${GITHUB_RUN_NUMBER} --tag registry.techsytes.com/docker-ftpython:latest
- name: Push the Docker image to DockerHub and Techsytes
run: |
docker push techmago/docker-ftpython:master-${GITHUB_RUN_NUMBER}
docker push techmago/docker-ftpython:latest
docker push registry.techsytes.com/docker-ftpython:master-${GITHUB_RUN_NUMBER}
docker push registry.techsytes.com/docker-ftpython:latest