Build and Publish DOMjudge #238
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: Build and Publish DOMjudge | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- pythoncourse | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout DOMjudge Repository | |
uses: actions/checkout@v3 | |
with: | |
repository: 'ItsNiklas/domjudge' | |
ref: 'pythoncourse' | |
path: 'domjudge' | |
# If the version contains DEV, add the hash. | |
- name: Get Version and Set TAG | |
run: | | |
cd domjudge | |
VERSION=$(grep 'version' README.md | sed -n '1s/^.*version //p') | |
[[ $VERSION == *DEV* ]] && TAG="${VERSION}-$(git rev-parse --short=7 HEAD)" || TAG="${VERSION}" | |
echo "TAG=${TAG}" >> $GITHUB_ENV | |
- name: Checkout DOMjudge Docker Repository | |
uses: actions/checkout@v3 | |
with: | |
path: 'domjudge-docker' | |
ref: 'pythoncourse' | |
- name: Create DOMjudge Snapshot | |
run: tar -czf domjudge-docker/domjudge-packaging/docker/domjudge.tar.gz domjudge | |
- name: Build DOMjudge | |
run: | | |
cd domjudge-docker/domjudge-packaging/docker/ | |
./build-domjudge.sh itsniklas/domjudge-domserver-pythoncourse:${{ env.TAG }} | |
docker tag itsniklas/domjudge-domserver-pythoncourse:${{ env.TAG }} itsniklas/domjudge-domserver-pythoncourse:latest | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Publish DOMjudge Image | |
run: | | |
docker push itsniklas/domjudge-domserver-pythoncourse:${{ env.TAG }} | |
docker push itsniklas/domjudge-domserver-pythoncourse:latest | |