Skip to content

Run cleanup only on byceps build #6

Run cleanup only on byceps build

Run cleanup only on byceps build #6

Workflow file for this run

name: Docker build and push
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '*.rst'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
NGINX_IMAGE_NAME: ${{ github.repository }}-nginx
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
system: [ byceps, nginx ]
steps:
- uses: actions/checkout@v2
- name: Clean up
if: matrix.system == 'byceps'
run: rm -rf .git/ .github/ sites/ data/ tests/ docs/ docker/nginx/ config/
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.system == 'nginx' && '-nginx' || '' }}
tags: |
type=raw,value=latest
type=raw,value=${{ github.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ${{ matrix.system == 'nginx' && 'docker/nginx/Dockerfile' || 'Dockerfile' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
VCS_REF=${{ github.sha }}
VERSION=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max