From d58f0e29eda20a8face865896b9a4ecb6529732f Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Thu, 16 Jul 2020 19:30:05 +0200 Subject: [PATCH] Build master and stable branches --- ...d-master.yaml => docker-build-latest.yaml} | 10 ++++---- .github/workflows/docker-build-stable.yaml | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) rename .github/workflows/{docker-build-master.yaml => docker-build-latest.yaml} (59%) create mode 100644 .github/workflows/docker-build-stable.yaml diff --git a/.github/workflows/docker-build-master.yaml b/.github/workflows/docker-build-latest.yaml similarity index 59% rename from .github/workflows/docker-build-master.yaml rename to .github/workflows/docker-build-latest.yaml index f3d8d47..e8bcdb9 100644 --- a/.github/workflows/docker-build-master.yaml +++ b/.github/workflows/docker-build-latest.yaml @@ -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 diff --git a/.github/workflows/docker-build-stable.yaml b/.github/workflows/docker-build-stable.yaml new file mode 100644 index 0000000..fc0603f --- /dev/null +++ b/.github/workflows/docker-build-stable.yaml @@ -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) \ No newline at end of file