-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (58 loc) · 1.92 KB
/
docker-image.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
57
58
59
60
61
# Github workflow runner instructions using cutomized actions
name: Refresher CI — Docker
on: [ push ]
jobs:
build-push:
runs-on: ubuntu-latest
name: build docker
steps:
########## CHECK OUT REPO AND PRINT REPO INFO #######
- name: Checkout
uses: actions/checkout@v3
- name: Intro to job runner
run: |
echo "job runner details "
echo "Event: ${{ github.event_name }}"
echo "os: ${{ runner.os }} server."
echo "Repository: ${{ github.repository }}:${{ github.ref_name }}."
ls ${{ github.workspace }}
######### DOCKER BUILD AND PUSH CUSTOM ACTION #############
- name: Docker Build and Push
uses: ./.github/actions/docker-build-push-image
with:
username:
${{ github.REPOSITORY_OWNER }}
password:
${{ secrets.pta }}
registry:
ghcr.io
repository:
${{ github.repository }}
tag:
${{ github.ref_name }}
file:
docker/Dockerfile
test_docker:
needs: build-push
runs-on: ubuntu-latest
name: test docker
steps:
########## CHECK OUT REPO AND PRINT REPO INFO #######
- name: Checkout
uses: actions/checkout@v3
######### DOCKER LOGIN AND PULL CUSTOM ACTION #############
- name: Docker Login and Pull
uses: ./.github/actions/docker-pull-image
with:
username:
${{ github.REPOSITORY_OWNER }}
password:
${{ secrets.pta }}
registry:
ghcr.io
repository:
${{ github.repository }}
tag:
${{ github.ref_name }}
- name: Run tests
run: docker run ghcr.io/${{ github.repository }}:${{ github.ref_name }} /bin/bash -c "coverage run manage.py test apps && coverage xml --data-file=.coverage && codecov --token=${{ secrets.codecov_token }} "