From 970783e90357fd729f3014b50b722939ee2fa4ac Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 31 Aug 2020 20:52:12 -0400 Subject: [PATCH 1/5] Simple Docker build on master pull request --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..918add5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Docker build +on: + pull_request: + branches: [master] + paths-ignore: + - .github/workflows/buildx-branch.yml + - .github/workflows/buildx-latest.yml + - .github/workflows/buildx-release.yml + - .github/workflows/dockerhub-description.yml + - .github/workflows/rust.yml + - extra + - _config.yml + - .gitignore + - .rustfmt.toml + - .gitignore + - example.json + - LICENSE + - README.md +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build image + run: docker build . From e9e0690a88c20436f09912de3e03639505e7552b Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 31 Aug 2020 20:52:37 -0400 Subject: [PATCH 2/5] Buildx tagged Docker build on branches --- .github/workflows/buildx-branch.yml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/buildx-branch.yml diff --git a/.github/workflows/buildx-branch.yml b/.github/workflows/buildx-branch.yml new file mode 100644 index 0000000..784ad3d --- /dev/null +++ b/.github/workflows/buildx-branch.yml @@ -0,0 +1,42 @@ +name: Buildx branch +on: + push: + branches: + - '*' + - '*/*' + - '!master' + paths-ignore: + - .github/workflows/build.yml + - .github/workflows/buildx-latest.yml + - .github/workflows/buildx-release.yml + - .github/workflows/dockerhub-description.yml + - .github/workflows/rust.yml + - extra + - _config.yml + - .gitignore + - .rustfmt.toml + - .gitignore + - example.json + - LICENSE + - README.md +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Buildx setup + uses: crazy-max/ghaction-docker-buildx@v1 + - name: Dockerhub login + run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u mindflavor --password-stdin 2>&1 + - name: Run Buildx + run: | + docker buildx build \ + --progress plain \ + --platform=linux/amd64,linux/386 \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg COMMIT=`git rev-parse --short HEAD` \ + --build-arg VERSION=${GITHUB_REF##*/} \ + -t mindflavor/prometheus-wireguard-exporter:${GITHUB_REF##*/} \ + --push \ + . + - run: curl -X POST https://hooks.microbadger.com/images/mindflavor/prometheus-wireguard-exporter/TODO || exit 0 From 4a13a268699c1ee17b0c62478d60def929ee910d Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 31 Aug 2020 20:52:50 -0400 Subject: [PATCH 3/5] Buildx latest on master branch changes --- .github/workflows/buildx-latest.yml | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/buildx-latest.yml diff --git a/.github/workflows/buildx-latest.yml b/.github/workflows/buildx-latest.yml new file mode 100644 index 0000000..bccaf86 --- /dev/null +++ b/.github/workflows/buildx-latest.yml @@ -0,0 +1,39 @@ +name: Buildx latest +on: + release: + types: [published] + paths-ignore: + - .github/workflows/build.yml + - .github/workflows/buildx-branch.yml + - .github/workflows/buildx-release.yml + - .github/workflows/dockerhub-description.yml + - .github/workflows/rust.yml + - extra + - _config.yml + - .gitignore + - .rustfmt.toml + - .gitignore + - example.json + - LICENSE + - README.md +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Buildx setup + uses: crazy-max/ghaction-docker-buildx@v1 + - name: Dockerhub login + run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u mindflavor --password-stdin 2>&1 + - name: Run Buildx + run: | + docker buildx build \ + --progress plain \ + --platform=linux/amd64,linux/386 \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg COMMIT=`git rev-parse --short HEAD` \ + --build-arg VERSION=latest \ + -t mindflavor/prometheus-wireguard-exporter:latest \ + --push \ + . + - run: curl -X POST https://hooks.microbadger.com/images/mindflavor/prometheus-wireguard-exporter/TODO || exit 0 From 610fcd1e0d84017ec6107fc7f62023a8cc6d8dae Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 31 Aug 2020 20:53:00 -0400 Subject: [PATCH 4/5] Buildx tagged Docker build on releases/tags --- .github/workflows/buildx-release.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/buildx-release.yml diff --git a/.github/workflows/buildx-release.yml b/.github/workflows/buildx-release.yml new file mode 100644 index 0000000..2e8b7c7 --- /dev/null +++ b/.github/workflows/buildx-release.yml @@ -0,0 +1,39 @@ +name: Buildx release +on: + release: + types: [published] + paths-ignore: + - .github/workflows/build.yml + - .github/workflows/buildx-branch.yml + - .github/workflows/buildx-latest.yml + - .github/workflows/dockerhub-description.yml + - .github/workflows/rust.yml + - extra + - _config.yml + - .gitignore + - .rustfmt.toml + - .gitignore + - example.json + - LICENSE + - README.md +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Buildx setup + uses: crazy-max/ghaction-docker-buildx@v1 + - name: Dockerhub login + run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u mindflavor --password-stdin 2>&1 + - name: Run Buildx + run: | + docker buildx build \ + --progress plain \ + --platform=linux/amd64,linux/386 \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + --build-arg COMMIT=`git rev-parse --short HEAD` \ + --build-arg VERSION=${GITHUB_REF##*/} \ + -t mindflavor/prometheus-wireguard-exporter:${GITHUB_REF##*/} \ + --push \ + . + - run: curl -X POST https://hooks.microbadger.com/images/mindflavor/prometheus-wireguard-exporter/TODO || exit 0 From f055d0a656a6d33d731d9caf25846dc83b924c23 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Mon, 31 Aug 2020 20:53:11 -0400 Subject: [PATCH 5/5] Docker Hub description sync --- .github/workflows/dockerhub-description.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/dockerhub-description.yml diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml new file mode 100644 index 0000000..c8c3fb2 --- /dev/null +++ b/.github/workflows/dockerhub-description.yml @@ -0,0 +1,19 @@ +name: Docker Hub description +on: + push: + branches: [master] + paths: + - README.md + - .github/workflows/dockerhub-description.yml +jobs: + dockerHubDescription: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v2.1.0 + env: + DOCKERHUB_USERNAME: mindflavor + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + DOCKERHUB_REPOSITORY: mindflavor/prometheus-wireguard-exporter