Skip to content

frontend-commit-event #1540

frontend-commit-event

frontend-commit-event #1540

Workflow file for this run

name: frontend
on:
release:
types: [created]
repository_dispatch:
types: frontend-commit-event
push:
# Publish `dev` as Docker `latest` image.
branches:
- main
paths:
- 'frontend/**'
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
IMAGE_NAME: librephotos-frontend
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: Run tests
run: echo "To-Do Add Tests"
build-amd64:
name: Building dev build (AMD64)
if: github.event_name != 'release'
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push (AMD64)
uses: docker/build-push-action@v2
with:
context: ./frontend
platforms: linux/amd64
push: true
tags: reallibrephotos/librephotos-frontend:dev-amd64
build-arm64:
name: Building dev build (ARM64)
if: github.event_name != 'release'
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-24.04-arm # Use ARM64 runner
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push (ARM64)
uses: docker/build-push-action@v2
with:
context: ./frontend
platforms: linux/arm64
push: true
tags: reallibrephotos/librephotos-frontend:dev-arm64
combine-manifest-dev:
name: Combine into multi-arch manifest (dev)
if: github.event_name != 'release'
needs: [build-amd64, build-arm64]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Enable Docker CLI experimental features
run: echo '{"experimental":"enabled"}' > ~/.docker/config.json
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Create and push multi-arch manifest (dev)
run: |
docker manifest create reallibrephotos/librephotos-frontend:dev \
reallibrephotos/librephotos-frontend:dev-amd64 \
reallibrephotos/librephotos-frontend:dev-arm64
docker manifest annotate reallibrephotos/librephotos-frontend:dev \
reallibrephotos/librephotos-frontend:dev-amd64 --arch amd64
docker manifest annotate reallibrephotos/librephotos-frontend:dev \
reallibrephotos/librephotos-frontend:dev-arm64 --arch arm64
docker manifest push reallibrephotos/librephotos-frontend:dev
release-amd64:
name: Releasing (AMD64)
if: github.event_name == 'release' && github.event.action == 'created'
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push (AMD64)
uses: docker/build-push-action@v2
with:
context: ./frontend
platforms: linux/amd64
push: true
tags: reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-amd64
release-arm64:
name: Releasing (ARM64)
if: github.event_name == 'release' && github.event.action == 'created'
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-24.04-arm # Use ARM64 runner
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push (ARM64)
uses: docker/build-push-action@v2
with:
context: ./frontend
platforms: linux/arm64
push: true
tags: reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-arm64
combine-manifest-release:
name: Combine into multi-arch manifest (release)
if: github.event_name == 'release' && github.event.action == 'created'
needs: [release-amd64, release-arm64]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Enable Docker CLI experimental features
run: echo '{"experimental":"enabled"}' > ~/.docker/config.json
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Create and push multi-arch manifest (release)
run: |
docker manifest create reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }} \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-amd64 \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-arm64
docker manifest annotate reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }} \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-amd64 --arch amd64
docker manifest annotate reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }} \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-arm64 --arch arm64
docker manifest push reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}
# Optionally, tag the release as "latest"
docker manifest create reallibrephotos/librephotos-frontend:latest \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-amd64 \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-arm64
docker manifest annotate reallibrephotos/librephotos-frontend:latest \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-amd64 --arch amd64
docker manifest annotate reallibrephotos/librephotos-frontend:latest \
reallibrephotos/librephotos-frontend:${{ github.event.release.tag_name }}-arm64 --arch arm64
docker manifest push reallibrephotos/librephotos-frontend:latest