forked from chaskiq/chaskiq
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (38 loc) · 1.16 KB
/
dockerimage.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
name: Push Docker Image
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Login into Registry
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/checkout@v2
- name: Get Short SHA
id: vars
run: |
echo ::set-output name=short_sha::$(git rev-parse --short=7 ${{ github.sha }})
- name: Build the Docker image
run: |
docker build --build-arg APP_ENV=production \
--build-arg RUBY_VERSION=2.6.5 \
--build-arg PG_MAJOR=11 \
--build-arg NODE_MAJOR=10 \
--build-arg YARN_VERSION=1.13.0 \
--build-arg BUNDLER_VERSION=2.1.3 \
-t $GITHUB_REPOSITORY \
.
- name: Tag and Push Docker image
run: |
docker tag $GITHUB_REPOSITORY $GITHUB_REPOSITORY:$SHORT_SHA
docker push $GITHUB_REPOSITORY:$SHORT_SHA
echo "SHORT_SHA: ${SHORT_SHA}"
env:
SHORT_SHA: ${{ steps.vars.outputs.short_sha }}