forked from DouweM/pixbyt
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.12 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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