Version 1.1.2rc0 #58
Workflow file for this run
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: publish-docker | |
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build image | |
run: docker buildx build . --tag "epicwink/proxpi:${{ github.ref_name }}" | |
- name: Run unit-tests in image | |
run: docker run | |
--rm | |
--volume "$(pwd)/tests:/srv/tests" | |
--entrypoint '' | |
"epicwink/proxpi:${{ github.ref_name }}" | |
sh -c 'pip install --requirement /srv/tests/requirements.txt | |
&& pytest -vvra /srv/tests' | |
- name: Login to DockerHub | |
run: > | |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | |
| docker login --password-stdin -u epicwink | |
- name: Publish image | |
run: docker push "epicwink/proxpi:${{ github.ref_name }}" | |
- name: Check tag | |
id: check-tag | |
run: | | |
if [[ "${{ github.ref_name }}" =~ ^v\d+\.\d+\.\d+$ ]]; then | |
echo ::set-output name=match::true | |
fi | |
- name: Publish latest image | |
if: steps.check-tag.outputs.match == 'true' | |
run: | | |
docker tag "epicwink/proxpi:${{ github.ref_name }}" epicwink/proxpi:latest | |
docker push epicwink/proxpi:latest |