-
Notifications
You must be signed in to change notification settings - Fork 185
42 lines (36 loc) · 1.34 KB
/
container-image.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
name: "Container image build for behave testing"
on:
schedule:
- cron: "0 2 * * 1" # every Monday at 2am UTC
# allow manual execution from the GitHub web interface
workflow_dispatch:
jobs:
build:
name: "Build obs-server:latest container image"
if: ${{ github.repository == 'openSUSE/osc' }}
runs-on: ubuntu-latest
steps:
- name: "Login to ghcr.io"
env:
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
run: |
echo "$GHCR_TOKEN" | podman login ghcr.io -u "$GHCR_USER" --password-stdin
- name: "Checkout sources"
uses: actions/checkout@v3
# This step is necessary to avoid the following error during podman build:
# (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
- name: "Allow binding privileged ports"
run: |
sudo sysctl net.ipv4.ip_unprivileged_port_start=0
- name: "Build image"
env:
REPO: ${{ github.repository }}
run: |
cd behave
./container-build.sh --squash --label="org.opencontainers.image.source=https://github.com/$REPO"
- name: "Push image to ghcr.io"
env:
GHCR_USER: ${{ secrets.GHCR_USER }}
run: |
podman push obs-server:latest "ghcr.io/$GHCR_USER/obs-server:latest"