Skip to content

Build Docker image - stable #10

Build Docker image - stable

Build Docker image - stable #10

name: "Build Docker image for stable channel"
on:
schedule:
- cron: "0 0 1 * *"
permissions:
contents: read
packages: write
jobs:
get-date:
runs-on: ubuntu-latest
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-latest
outputs:
PKG_VER: ${{ steps.version.outputs.PKG_VER }}
steps:
- name: Disable Firefox snap
run: |
echo -e "Package: firefox*\nPin: release o=Ubuntu*\nPin-Priority: -1" | sudo tee -a /etc/apt/preferences.d/no-firefox-snap
- name: Add Firefox PPA
run: |
sudo add-apt-repository ppa:mozillateam/ppa -y
sudo apt-get update
- name: Get package version
id: version
run: |
PKG_VER=$(apt list firefox | awk -F'[ /]' '/firefox/ {print $3}' | cut -d'+' -f1)
echo "PKG_VER=${PKG_VER}" >> $GITHUB_OUTPUT
echo "The package version is $PKG_VER"
build-image:
runs-on: ubuntu-latest
needs: [get-date, get-version]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: 'stable'
- 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.GITHUB_TOKEN }}
- name: Build and push image for amd64/arm64
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./Dockerfile
push: true
build-args: |
IMAGE_BUILD_DATE=${{ needs.get-date.outputs.IMG_DATE }}
tags: |
ghcr.io/tibor309/firefox:latest
ghcr.io/tibor309/firefox:stable
ghcr.io/tibor309/firefox:${{ needs.get-version.outputs.PKG_VER }}