Rework repo structure so we can reuse files #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build & Publish | |
on: # yamllint disable-line rule:truthy | |
schedule: | |
- cron: "0 0 1,15 * *" # Every 2 weeks | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-publish: | |
name: Build & Publish | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- postgis-test | |
- vue-base | |
version: [latest] | |
include: | |
- image: vue-base | |
version: unsecured | |
unsecured: true | |
steps: | |
- name: Checkout | |
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 Docker GitHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./${{ matrix.image }}/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${{ matrix.version }} | |
build-args: | | |
UNSECURED=${{ matrix.unsecured }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |