Skip to content

Build and Deploy

Build and Deploy #466

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
workflow_run:
workflows: ['Trigger Build']
types: [completed]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute tags
id: tags
run: |
echo "DATE=$(date '+%Y%m%d')" >> "$GITHUB_OUTPUT"
echo "NAME=ghcr.io/fwcd/archlinux" >> "$GITHUB_OUTPUT"
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/riscv64,linux/ppc64le
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.tags.outputs.NAME }}:latest,${{ steps.tags.outputs.NAME }}:${{ steps.tags.outputs.DATE }}