-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (31 loc) · 979 Bytes
/
push.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
name: Publish container
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@master
id: checkout
- name: Logging in to container registry...
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- name: Building Docker image...
env:
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
run:
docker build --rm -t $DOCKER_IMAGE:latest -t $DOCKER_IMAGE:master-$(echo ${GITHUB_SHA} | head -c7) .
- name: Publishing image...
env:
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
run: docker push $DOCKER_IMAGE:master-$(echo ${GITHUB_SHA} | head -c7)
- name: Tag this with latest...
env:
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
run: docker push $DOCKER_IMAGE:latest