🚧 wip #4
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, Test, Push | |
on: | |
push | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-test-push: | |
runs-on: ubuntu-latest | |
steps: | |
### Build | |
- name: Build / Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build / Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build / Build Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
load: true | |
tags: pixbyt:dev | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
### Test | |
- name: Test / Set up Docker Compose | |
uses: KengoTODA/[email protected] | |
with: | |
version: '2.20.2' | |
- name: Test / Create .env, apps.yml, and devices.yml from sample | |
run: | | |
cp .env.sample .env | |
cp -n apps.yml.sample apps.yml | |
cp -n devices.yml.sample devices.yml | |
- name: Test / Render hello-world to image | |
run: | | |
docker compose run -e TAP_PIXLET_MAGNIFICATION=8 pixbyt run hello-world--webp | |
sudo mv output/**/*.webp output/hello-world.webp | |
- name: Test / Store image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hello-world | |
path: output/hello-world.webp | |
### Push | |
- name: Push / Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push / Extract Docker metadata (tags, labels) | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Push / Push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |