2019-12-15 16:54:03 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-03-16 19:35:42 +00:00
|
|
|
- uses: actions/checkout@v3
|
2019-12-15 16:54:03 +00:00
|
|
|
|
2020-03-07 18:08:09 +00:00
|
|
|
- name: shellcheck
|
2020-07-11 10:34:12 +00:00
|
|
|
uses: azohra/shell-linter@v0.4.0
|
2020-03-07 18:08:09 +00:00
|
|
|
|
|
|
|
- name: hadolint
|
|
|
|
uses: brpaz/hadolint-action@master
|
|
|
|
|
2019-12-15 16:54:03 +00:00
|
|
|
- name: Build image
|
|
|
|
run: ./build.sh
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: ./tests/test.sh
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-10 10:07:52 +00:00
|
|
|
needs:
|
|
|
|
- tests
|
2019-12-15 16:54:03 +00:00
|
|
|
if: github.event_name == 'push'
|
|
|
|
steps:
|
2023-03-16 19:35:42 +00:00
|
|
|
- uses: actions/checkout@v3
|
2019-12-15 16:54:03 +00:00
|
|
|
|
|
|
|
- name: Log in to dockerhub
|
|
|
|
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
|
|
|
|
|
|
|
- name: Deploy image
|
|
|
|
run: ./build.sh --push --latest
|