build-manual #19
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: build-manual | |
on: | |
workflow_dispatch: | |
# push: | |
# paths: | |
# - Dockerfile | |
# - Makefile | |
env: | |
PLATFORMS: linux/arm/v6,linux/arm/v7,linux/arm64,linux/amd64 | |
permissions: | |
packages: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU need for cross-platform building | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
- name: Set up for "docker buildx" | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
- name: Login to GitHub's container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: VERSION file to CI envvars | |
run: | | |
cat VERSION | awk '{ print "MAKED_NAME=" $1 }' >> $GITHUB_ENV | |
cat VERSION | awk '{ print "MAKED_VER=" $2 }' >> $GITHUB_ENV | |
cat VERSION | awk '{ print "MAKED_CHANNEL=" $3 }' >> $GITHUB_ENV | |
# This gets a build error, something about the readme perhaps, but dunno. | |
- name: Add README to Docker Hub | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
repository: ammo74/make.d | |
readme-filepath: "./README.md" | |
short-description: "make.d - RouterOS-friendly Alpine /container, managed by Makefile" | |
- name: Build image and push image - BASE | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
sbom: false | |
provenance: false | |
platforms: ${{ env.PLATFORMS }} | |
tags: | | |
ghcr.io/${{ github.repository }}:latest | |
ghcr.io/${{ github.repository }}:${{ env.MAKED_CHANNEL }} | |
ghcr.io/${{ github.repository }}:${{ env.MAKED_VER }} | |
ammo74/make.d:latest | |
ammo74/make.d:${{ env.MAKED_VER }} | |
ammo74/make.d:${{ env.MAKED_CHANNEL }} | |
build-args: | | |
GHCR_REPO=${{ github.repository }} | |
GHCR_TAG=${{ steps.meta.outputs.tags }} | |
GHCR_PLATFORMS=${{ env.PLATFORMS }} | |
- name: Build image and push image - MAX | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
sbom: false | |
provenance: false | |
platforms: ${{ env.PLATFORMS }} | |
tags: | | |
ghcr.io/${{ github.repository }}-max:latest | |
ghcr.io/${{ github.repository }}-max:${{ env.MAKED_CHANNEL }} | |
ghcr.io/${{ github.repository }}-max:${{ env.MAKED_VER }} | |
ammo74/make.d-max:latest | |
ammo74/make.d-max:${{ env.MAKED_VER }} | |
ammo74/make.d-max:${{ env.MAKED_CHANNEL }} | |
build-args: | | |
GHCR_REPO=${{ github.repository }} | |
GHCR_TAG=${{ steps.meta.outputs.tags }} | |
GHCR_PLATFORMS=${{ env.PLATFORMS }} | |
DOCKER_ADDITIONAL_TARGETS=install-all |