-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.61 KB
/
Docker-Build-Test.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
on:
workflow_run:
workflows: ['R-CMD-Check']
types: [completed]
branches: [arg-pkg]
name: Docker-Build-Test
jobs:
rcmdcheck-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
TEST_TAG: bhedayat/test-primace:test
LATEST_TAG: bhedayat/test-primace:latest
LIARA_ENDPOINT: ${{ secrets.LIARA_ENDPOINT }}
LIARA_BUCKET_NAME: ${{ secrets.LIARA_BUCKET_NAME }}
LIARA_ACCESS_KEY: ${{ secrets.LIARA_ACCESS_KEY }}
LIARA_SECRET_KEY: ${{ secrets.LIARA_SECRET_KEY }}
MARIADB_DB: ${{ secrets.MARIADB_DB }}
MARIADB_USR: ${{ secrets.MARIADB_USR }}
MARIADB_PW: ${{ secrets.MARIADB_PW }}
MARIADB_TBL: ${{ secrets.MARIADB_TBL }}
MARIADB_HOST: ${{ secrets.MARIADB_HOST }}
MARIADB_PORT: ${{ secrets.MARIADB_PORT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: .
load: true
tags: ${{ env.TEST_TAG }}
build-args: |
GIT_PAT=${{ secrets.GITHUB_TOKEN }}
LIARA_ENDPOINT=${{ secrets.LIARA_ENDPOINT }}
LIARA_BUCKET_NAME=${{ secrets.LIARA_BUCKET_NAME }}
LIARA_ACCESS_KEY=${{ secrets.LIARA_ACCESS_KEY }}
LIARA_SECRET_KEY=${{ secrets.LIARA_SECRET_KEY }}
MARIADB_DB=${{ secrets.MARIADB_DB }}
MARIADB_TBL=${{ secrets.MARIADB_TBL }}
MARIADB_USR=${{ secrets.MARIADB_USR }}
MARIADB_PW=${{ secrets.MARIADB_PW }}
MARIADB_HOST=${{ secrets.MARIADB_HOST }}
MARIADB_PORT=${{ secrets.MARIADB_PORT}}
- name: Test
run : |
echo "Starting docker..." &&
docker run -d -p 3838:3838 --rm ${{ env.TEST_TAG }} &
echo "Docker run successfully..." &&
sleep 10 &&
echo "Sleep terminated..." &&
if [[ $(curl --silent 0.0.0.0:3838) ]]; then echo Done; else echo "Error" 1>&2 && exit 64; fi
rcmdcheck-failed:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: "Failed due to R-CMD-Check failure"