Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Builds via GitHub Actions #30

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Docker image on push

on: push

env:
DOCKER_CLI_EXPERIMENTAL: enabled

jobs:
build:
name: Build Docker image
runs-on: ubuntu-18.04
steps:
- name: Checkout project
uses: actions/checkout@v2

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

- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
id: buildx

- name: Show available Docker buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag sensei \
.
41 changes: 41 additions & 0 deletions .github/workflows/on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and publish Docker image on tag

on:
push:
tags:
- 'v*.*.*'

env:
DOCKER_CLI_EXPERIMENTAL: enabled

jobs:
build:
name: Build Docker image
runs-on: ubuntu-18.04
steps:
- name: Set VERSION
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Checkout project
uses: actions/checkout@v2

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

- name: Setup Docker buildx action
uses: docker/setup-buildx-action@v1
id: buildx

- name: Show available Docker buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}

- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_HUB_USER }}/sensei:$VERSION \
--push .