Skip to content

Commit

Permalink
Add GitHub workflow to build latest Docker image
Browse files Browse the repository at this point in the history
This workflow will be triggered when something is changed inside either
the `src/` or the `.github/workflows/` folder on either the "main" or
the "master" branch, all other changes will be ignored. This should
be fine since an edit to the README would not affect how the Docker
container is being built.

More info about this can be found in issue #28:
#28
  • Loading branch information
JonasAlfredsson committed Mar 31, 2021
1 parent 14e4e72 commit 78c94a4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "build-latest"

on:
push:
branches:
- "main"
- "master"
paths:
- "src/**"
- ".github/workflows/**"

jobs:
docker_buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v2

- name: Set up QEMU environment
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push all images
uses: docker/build-push-action@v2
with:
context: ./src
platforms: |
linux/amd64
linux/386
linux/arm64
linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
build-args: BUILDX_QEMU_ENV=true
tags: jonasal/nginx-certbot:latest

0 comments on commit 78c94a4

Please sign in to comment.