-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (30 loc) · 901 Bytes
/
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
name: bBot CI
on:
push:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker build
run: |
echo 'Building bBot Docker Image'
export NAME='taranvohra/bbot'
export TAG=`git log -1 --pretty=%h`
export CURRENT="${NAME}:${TAG}"
export LATEST="${NAME}:latest"
docker build -t ${CURRENT} .
docker tag ${CURRENT} ${LATEST}
- name: Docker Login
env:
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
docker login -u $DOCKER_ID -p $DOCKER_PASSWORD
- name: Docker Publish
run: |
docker push taranvohra/bbot
echo 'Done ✅'