-
Notifications
You must be signed in to change notification settings - Fork 22
42 lines (36 loc) · 1.33 KB
/
build.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
name: Build Desktop Environment
on: [push, workflow_call]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Sanitise repository owner
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ env.REPOSITORY_OWNER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push to GitHub Container Registry
uses: docker/build-push-action@v4
with:
build-args: |
DESKTOP_ENVIRONMENT_USER=${{ env.REPOSITORY_OWNER }}
DESKTOP_ENVIRONMENT_GITHUB_USER=${{ env.REPOSITORY_OWNER }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: docker/Dockerfile
push: true
tags: ghcr.io/${{ env.REPOSITORY_OWNER }}/desktop-environment:latest
- name: Run desktop environment tests
run: ./docker/scripts/test.sh
env:
DESKTOP_ENVIRONMENT_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER }}
continue-on-error: true