armbian-build/.github/workflows/build-docker.yml
Igor Pečovnik c1b8ab8755
Recreate Docker image on every code change (#3276)
* Add switch for clean Docker image preparation
* Link image to our GitHub repository
* Switch to Github repo
* Minimal variant
* Rename
2021-11-21 09:41:31 +01:00

38 lines
917 B
YAML

name: Build Docker image
on:
# Trigger the workflow on push but only for the main branch
push:
branches:
- master
# Trigger manually
workflow_dispatch:
jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- uses: actions/checkout@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
- name: Build Docker image
run: |
sed -i "s/-it --rm/-i --rm/" config/templates/config-docker.conf
touch .ignore_changes
./compile.sh docker JUST_INIT="yes"
docker tag armbian:$(cat VERSION) ghcr.io/armbian/build:$(cat VERSION)
- name: Push Docker image
run: docker push ghcr.io/armbian/build:$(cat VERSION)