Update self-hosted CD #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: container | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: [snail-runners] | |
steps: | |
- name: Login to local container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.LOCAL_REG_URL }} | |
username: ${{ secrets.LOCAL_REG_USER }} | |
password: ${{ secrets.LOCAL_REG_PASS }} | |
- name: Install git | |
run: sudo apt-get update && sudo apt-get install -y git | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Build the container | |
run: docker build . --file ./docker/Dockerfile --tag ${{ secrets.LOCAL_REG_URL }}/secret-snail/localization-server:latest | |
- name: Run the tests in the container | |
run: | | |
docker run --rm ${{ secrets.LOCAL_REG_URL }}/secret-snail/localization-server:latest \ | |
bash -c "cd ./build && ctest" | |
- name: Push the container | |
run: docker push ${{ secrets.LOCAL_REG_URL }}/secret-snail/localization-server:latest |