From b06bd9a27938498f9be0322fc17630437ae32d03 Mon Sep 17 00:00:00 2001 From: Jean-Marc Tremeaux Date: Mon, 28 Sep 2020 15:06:53 +0200 Subject: [PATCH] Add CD --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 3 +++ Dockerfile | 5 ++++- README.md | 7 +++++-- build.sh | 3 --- 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 CHANGELOG.md delete mode 100644 build.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4961bd9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build and deploy Docker image + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push Docker image + id: docker_build + uses: docker/build-push-action@v2 + with: + push: true + tags: sismics/debian:${{ steps.get_version.outputs.VERSION }} + - name: Create Github Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ steps.get_version.outputs.VERSION }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..757a859 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## Change Log +### Version 9.0.0 (2017-09-25) +- Initial release diff --git a/Dockerfile b/Dockerfile index deed3a1..800db1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,10 @@ MAINTAINER Jean-Marc Tremeaux ENV DEBIAN_FRONTEND noninteractive # Install Sismics repository & a few utils -RUN apt-get update && apt-get install -y apt-transport-https software-properties-common wget curl gnupg vim less procps unzip +RUN apt-get update && \ + apt-get install -y apt-transport-https software-properties-common wget curl gnupg vim less procps unzip && \ + rm -rf /var/lib/apt/lists/* + RUN curl -fsSL https://www.sismics.com/pgp | apt-key add - RUN add-apt-repository "deb [arch=amd64] https://nexus.sismics.com/repository/apt-stretch/ stretch main" diff --git a/README.md b/README.md index 52c3549..f627303 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# docker-debian -Dockerfile for Debian +[![GitHub release](https://img.shields.io/github/release/sismics/debian.svg?style=flat-square)](https://github.com/sismics/docker-backupninja/releases/latest) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) + +## About +Docker image for Debian diff --git a/build.sh b/build.sh deleted file mode 100644 index 2b23407..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -docker build -t sismics/debian:stretch . -docker push sismics/debian:stretch \ No newline at end of file