Build master and stable branches

This commit is contained in:
Felipe Martin 2020-07-16 19:30:05 +02:00 committed by Felipe M
parent e6eecb3a12
commit d58f0e29ed
Signed by: fmartingr
GPG Key ID: 716BC147715E716F
2 changed files with 28 additions and 5 deletions

View File

@ -1,4 +1,4 @@
name: Build Docker master image
name: Build latest tag docker image
on:
push:
@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build --tag butterrobot:$(git rev-parse --short master) docker
run: docker build --tag butterrobot:$(git rev-parse --short HEAD) docker
- name: Push into Github packages
- name: Push into Github packages (latest)
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u fmartingr --password-stdin
docker tag butterrobot:$(git rev-parse --short master) docker.pkg.github.com/fmartingr/butterrobot/butterrobot:$(git rev-parse --short master)
docker push docker.pkg.github.com/fmartingr/butterrobot/butterrobot:$(git rev-parse --short master)
docker tag butterrobot:$(git rev-parse --short HEAD) docker.pkg.github.com/fmartingr/butterrobot/butterrobot:master
docker push docker.pkg.github.com/fmartingr/butterrobot/butterrobot:master

View File

@ -0,0 +1,23 @@
name: Build stable tag docker image
on:
push:
branches:
- stable
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build --tag butterrobot:$(git rev-parse --short HEAD) docker
- name: Push into Github packages (stable)
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u fmartingr --password-stdin
docker tag butterrobot:$(git rev-parse --short HEAD) docker.pkg.github.com/fmartingr/butterrobot/butterrobot:stable
docker tag butterrobot:$(git rev-parse --short HEAD) docker.pkg.github.com/fmartingr/butterrobot/butterrobot:$(cat pyproject.toml | grep version | cut -d "\"" -f 2)
docker push docker.pkg.github.com/fmartingr/butterrobot/butterrobot:stable
docker push docker.pkg.github.com/fmartingr/butterrobot/butterrobot:$(cat pyproject.toml | grep version | cut -d "\"" -f 2)