Add Workflows #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test image build | |
on: | |
pull_request: | |
jobs: | |
build-image: | |
name: Build image | |
runs-on: ubuntu-latest | |
steps: | |
# Setup QEMU for multi-arch builds | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
# Adding Docker Buildx cache | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Adding docker hub login | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Adding docker build test without pushing | |
- name: Docker build | |
uses: docker/build-push-action@v5 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
platforms: linux/amd64,linux/arm64 | |
tags: nmofonseca/nettools:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |