-
Notifications
You must be signed in to change notification settings - Fork 12
61 lines (57 loc) · 2.64 KB
/
main.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
on: [push]
name: CI
jobs:
build-docker-container:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Build the docker image
run: |
export TAG=${GITHUB_SHA:0:8}
echo "$DOCKER_PASSWORD" | docker login docker.pkg.github.com -u "$DOCKER_USERNAME" --password-stdin
docker-compose -f docker-compose.yaml build
if: github.ref == 'refs/heads/master' || contains(github.ref,'bdc_')
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: branch Push Docker image to github package registry
run: |
export TAG=${GITHUB_SHA:0:8}
echo "$DOCKER_PASSWORD" | docker login docker.pkg.github.com -u "$DOCKER_USERNAME" --password-stdin
docker-compose -f docker-compose.yaml push
if: github.ref == 'refs/heads/master' || contains(github.ref,'bdc_')
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Build the docker image with latest tag
run: |
echo "$DOCKER_PASSWORD" | docker login docker.pkg.github.com -u "$DOCKER_USERNAME" --password-stdin
docker-compose -f docker-compose.yaml build
if: github.ref == 'refs/heads/master'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: branch Push Docker image to github package registry with latest tag
run: |
echo "$DOCKER_PASSWORD" | docker login docker.pkg.github.com -u "$DOCKER_USERNAME" --password-stdin
docker-compose -f docker-compose.yaml push
if: github.ref == 'refs/heads/master'
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Build the docker image with latest tag for dockerhub
run: |
echo "$DOCKERHUB_PASSWORD" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
docker-compose -f docker-compose-dockerhub.yaml build
if: github.ref == 'refs/heads/master'
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: branch Push Docker image to dockerhub registry with latest tag
run: |
echo "$DOCKERHUB_PASSWORD" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
docker-compose -f docker-compose-dockerhub.yaml push
if: github.ref == 'refs/heads/master'
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}