-
Notifications
You must be signed in to change notification settings - Fork 24
61 lines (55 loc) · 1.88 KB
/
backend-ci.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
name: Backend Continuous Integration
on:
pull_request:
paths:
- '.github/workflows/backend-ci.yml'
- 'api/**'
- '!api/.gitignore'
- '!api/README.md'
- '.gitmodules'
push:
paths:
- '.github/workflows/backend-ci.yml'
- 'api/**'
- '!api/.gitignore'
- '!api/README.md'
- '.gitmodules'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Docker login
env:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
run: docker login https://docker.pkg.github.com -u ${username} -p ${password}
- name: Build Third Party Image
env:
DOCKER_BUILDKIT: 1
run: |
cd ./api
if git diff --exit-code ../.gitmodules || git diff --exit-code ./third-party || git diff --exit-code ./Dockerfile
then
docker build . -t docker.pkg.github.com/memelabs/rustla2/rustla2-api:thirdPartyBase --build-arg APP_ENV=full --target full-build
else
return 0
fi
- name: Build API Image
env:
DOCKER_BUILDKIT: 1
run: cd ./api && docker build . -t docker.pkg.github.com/memelabs/rustla2/rustla2-api:stable
- name: Download container structure test binary
uses: fnkr/github-action-git-bash@v1
with:
args: "wget -O ./api/container-structure-test https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64"
- name: Chmod
uses: fnkr/github-action-git-bash@v1
with:
args: "chmod +x ./api/container-structure-test"
- name: Test image
uses: fnkr/github-action-git-bash@v1
with:
args: "./api/container-structure-test test --image docker.pkg.github.com/memelabs/rustla2/rustla2-api:stable --config ./api/container_test.yaml"