Skip to content

Use API more idiomatically #100

Use API more idiomatically

Use API more idiomatically #100

Workflow file for this run

name: Docker
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build-push-image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env: production
label: latest
- env: staging
label: staging
steps:
- 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: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/projectlighthousecau/luna
tags: |
type=raw,value=${{ matrix.label }},enable={{is_default_branch}}
type=sha,format=long
- name: Build and Push image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64/v8
network: host
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"DEPLOYMENT_ENVIRONMENT=${{ matrix.env }}"