-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.63 KB
/
webserver.yaml
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
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2022 Sascha Brawer <[email protected]>
#
# GitHub action to test and package webserver
name: Test and package webserver
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install \
-r webserver/requirements.txt \
-r webserver/requirements-dev.txt
- name: Run unit tests
run: pytest webserver/
package:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v3
- name: Find container metadata
id: container-metadata
uses: docker/metadata-action@v4
with:
images: ghcr.io/brawer/brandy/webserver
- name: Build container image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
layers: false
tags: ${{ steps.container-metadata.outputs.tags }}
labels: ${{ steps.container-metadata.outputs.labels }}
containerfiles: webserver/Containerfile
- name: Push to GitHub Container Registry
id: push-to-github
uses: redhat-actions/push-to-registry@v2
with:
image: ghcr.io/brawer/brandy/webserver
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}