-
Notifications
You must be signed in to change notification settings - Fork 8
50 lines (42 loc) · 1.74 KB
/
docker_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
48
49
50
name: Create Docker Image
on:
push:
paths:
- 'Dockerfile'
- '.github/workflows/docker_image.yml'
- 'requirements.txt'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log into Github registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build the Docker image
run: |
DATE=$(date "+%Y-%m-%d")
docker build . --file Dockerfile\
--tag docker.pkg.github.com/moda-nyc/db-recovery-data-partnership/rdp:$DATE
docker tag docker.pkg.github.com/moda-nyc/db-recovery-data-partnership/rdp:$DATE\
docker.pkg.github.com/moda-nyc/db-recovery-data-partnership/rdp:latest
docker push docker.pkg.github.com/moda-nyc/db-recovery-data-partnership/rdp:$DATE
docker push docker.pkg.github.com/moda-nyc/db-recovery-data-partnership/rdp:latest
- name: Log into Docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin
- name: Push to Dockerhub
shell: bash
run: |
DATE=$(date "+%Y-%m-%d")
docker tag docker.pkg.github.com/moda-nyc/db-recovery-data-partnership/rdp:$DATE nycplanning/rdp:$DATE
docker push nycplanning/rdp:$DATE
docker tag nycplanning/rdp:$DATE nycplanning/rdp:latest
docker push nycplanning/rdp:latest
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@master
with:
status: ${{ job.status }}
mention_users: 'U01J189FNNP'
mention_users_when: 'failure,warnings'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}