Skip to content

Build Docker image - workflow_dispatch #9

Build Docker image - workflow_dispatch

Build Docker image - workflow_dispatch #9

name: Manual rebuild
on:
[workflow_dispatch]
jobs:
get-date:
runs-on: ubuntu-24.04
outputs:
IMG_DATE: ${{ steps.date.outputs.IMG_DATE }}
steps:
- name: Get current date in RFC 3339
id: date
run: |
IMG_DATE=$(date --rfc-3339=seconds | sed 's/ /T/')
echo "IMG_DATE=${IMG_DATE}" >> $GITHUB_OUTPUT
echo "The date is $IMG_DATE"
get-version:
runs-on: ubuntu-24.04
outputs:
PKG_VER: ${{ steps.version.outputs.PKG_VER }}
steps:
- name: Download latest build
run: |
curl -vSLo zen.linux-generic.tar.bz2 https://github.com/zen-browser/desktop/releases/latest/download/zen.linux-x86_64.tar.bz2
- name: Extract package
run: |
tar -xvf zen.linux-generic.tar.bz2 \
zen/zen \
zen/dependentlibs.list \
zen/libnspr4.so \
zen/libplc4.so \
zen/libplds4.so \
zen/libmozsandbox.so \
zen/libgkcodecs.so \
zen/liblgpllibs.so \
zen/libnssutil3.so \
zen/libnss3.so \
zen/libsmime3.so \
zen/libmozsqlite3.so \
zen/libssl3.so \
zen/libmozgtk.so \
zen/libmozwayland.so \
zen/libxul.so
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libasound2t64 \
libgtk-3-0t64 \
libx11-xcb1
- name: Get package version
id: version
run: |
PKG_VER=$(./zen/zen --version | awk '{print $3}')
echo "PKG_VER=${PKG_VER}" >> $GITHUB_OUTPUT
echo "The package version is $PKG_VER"
rebuild:
runs-on: ubuntu-24.04
needs: [get-date, get-version]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: tibor309
password: ${{ secrets.GH_TOKEN }}
- name: Build image for amd64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
file: ./Dockerfile
push: true
provenance: false
build-args: |
IMAGE_BUILD_DATE=${{ needs.get-date.outputs.IMG_DATE }}
tags: |
ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-amd64
- name: Build image for arm64
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
file: ./Dockerfile.aarch64
push: true
provenance: false
build-args: |
IMAGE_BUILD_DATE=${{ needs.get-date.outputs.IMG_DATE }}
tags: |
ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-arm64
- name: Create image manifest with version tag
run: |
docker manifest create ghcr.io/tibor309/zen:${{ needs.get-version.outputs.PKG_VER }} \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-amd64 \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-arm64
- name: Create image manifest with latest tag
run: |
docker manifest create ghcr.io/tibor309/zen:latest \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-amd64 \
--amend ghcr.io/tibor309/${{ secrets.DEV_REPO }}:${{ needs.get-version.outputs.PKG_VER }}-arm64
- name: Push image manifests
run: |
docker manifest push ghcr.io/tibor309/zen:latest
docker manifest push ghcr.io/tibor309/zen:${{ needs.get-version.outputs.PKG_VER }}