forked from podtato-head/podtato-head
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.33 KB
/
microservices-build-tests.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
54
name: podtato-head-microservices-tests
on:
- push
- pull_request
permissions:
packages: write
env:
CONTAINER_REGISTRY: ghcr.io
GITHUB_TOKEN: ${{ github.token }}
GITHUB_USER: ${{ github.repository_owner }}
defaults:
run:
shell: bash
jobs:
push_images:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set custom tag/version
if: github.ref_name != 'main'
env:
BRANCH: ${{ github.ref_name }}
run: |
if [[ "${BRANCH}" =~ 'release-' ]]; then
# release branch: extracting version from branch name
echo "VERSION=${BRANCH#'release-'}" >> $GITHUB_ENV
# else
# consider adding something like this to isolate test tags
#
# to ensure downstream tests still work, support for the ${VERSION}
# env var needs to be added to them too so that they can update
# image tags
#
# echo "VERSION=test" >> ${GITHUB_ENV}
fi
- name: Push images
run: make push-microservices-images
test_services:
needs: push_images
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Test services
run: make test-microservices