-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (25 loc) · 959 Bytes
/
deploy.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
name: Baker.go
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: extract version from tag
id: tag_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- uses: actions/checkout@v2
- name: build
env:
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }}
DOCKER_SECRET: ${{ secrets.DOCKER_SECRET }}
run: |
GIT_COMMIT=$(git rev-list -1 HEAD)
VERSION=${{ steps.tag_version.outputs.VERSION }}
docker build --build-arg GIT_COMMIT=$GIT_COMMIT --build-arg VERSION=$VERSION -t alinz/baker.go:$VERSION .
docker build --build-arg GIT_COMMIT=$GIT_COMMIT --build-arg VERSION=$VERSION -t alinz/baker.go:latest .
echo ${{ secrets.DOCKER_SECRET }} | docker login -u ${{ secrets.DOCKER_LOGIN }} --password-stdin
docker push alinz/baker.go:$VERSION
docker push alinz/baker.go:latest