chore: Add GitHub Actions workflow for building Docker images
This commit is contained in:
parent
b4e388409c
commit
5e6d03d093
1 changed files with 42 additions and 0 deletions
42
.github/workflows/pull_request.yml
vendored
Normal file
42
.github/workflows/pull_request.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
name: Build Docker Images
|
||||||
|
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: mtubev7
|
||||||
|
DOCKER_REPOSITORY: ${{ github.repository_owner }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set outputs
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/arm/v7
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ env.DOCKER_REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.branch }}
|
||||||
Loading…
Reference in a new issue