-
-
Notifications
You must be signed in to change notification settings - Fork 81
56 lines (47 loc) · 1.68 KB
/
branch.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
---
name: Automation Tests
on:
push:
branches:
- master
jobs:
build:
name: CD Build
runs-on: ubuntu-22.04
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Install Testing Requirements
run: |
sudo pip install -U pip setuptools wheel
sudo pip install -r requirements-test.txt
- name: Lint
run: openwisp-qa-check --skip-checkmigrations
- name: Setup
run: |
echo "127.0.0.1 dashboard.openwisp.org api.openwisp.org" | sudo tee -a /etc/hosts
# disable metric collection during builds
sed -i 's/METRIC_COLLECTION=True/METRIC_COLLECTION=False/' .env
# the following action is equivalent to
# echo "$DOCKER_HUB_SECRET" | docker login --username "$DOCKER_HUB_USERNAME" --password-stdin
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_SECRET }}
- name: Build & Publish to Docker Hub
run: |
make publish TAG=edge USER=registry.docker.com/openwisp || (docker-compose logs && exit 1)
env:
SELENIUM_HEADLESS: 1
- name: Login to GitLab Container Registry
uses: docker/login-action@v1
with:
registry: registry.gitlab.com
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.GITLAB_DOCKER_REGISTRY_TOKEN }}
# Skip image builds and tests since they were done when
# publishing to Docker Hub
- name: Build & Publish to GitLab Container Registry
run: |
make publish TAG=edge SKIP_BUILD=true SKIP_TESTS=true