fix appointment perms #63
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: Create Release and Deploy Docker | |
on: | |
push: | |
tags: | |
- "*" # Trigger on any tag creation. | |
jobs: | |
build-and-release: | |
name: Build and Release | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y wget gnupg lsb-release ca-certificates gpg software-properties-common apt-transport-https | |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | |
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null | |
sudo apt-get update | |
sudo apt-get install -y build-essential git bash ninja-build libpq-dev curl openssh-client python3-full python3-pip cmake | |
- name: Install Conan | |
run: | | |
pip install --user conan | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
conan --version | |
conan profile detect --force | |
- name: Install Dependencies with Conan | |
run: | | |
conan install ${{ github.workspace }} -s arch=x86_64 -s build_type=Release -s compiler=gcc \ | |
-s compiler.cppstd=gnu20 -s compiler.version=14.2 -s os=Linux \ | |
-s compiler.libcxx=libstdc++11 \ | |
-c tools.cmake.cmaketoolchain:generator=Ninja --build=missing | |
- name: Verify CMake Version | |
run: cmake --version | |
- name: Configure CMake | |
run: cmake -B ${{ github.workspace }}/build/Release -GNinja -DCMAKE_BUILD_TYPE=Release | |
- name: Build | |
run: cmake --build ${{ github.workspace }}/build/Release -j$(nproc) | |
- name: Get Commit Message | |
id: get_commit_msg | |
run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $GITHUB_ENV | |
- name: Compress release | |
run: | | |
tar -czvf ${{ github.workspace }}/server-x86_64.tar.gz -C ${{ github.workspace }}/build/Release server | |
- name: Create and Upload Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
body: | | |
- ${{ env.COMMIT_MESSAGE }} | |
draft: false | |
prerelease: true | |
artifacts: ${{ github.workspace }}/server-x86_64.tar.gz | |
build-and-push-docker: | |
name: Build and Push Docker | |
needs: build-and-release # Run only after the `build-and-release` job is successful. | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Install needed tools | |
run: | | |
sudo apt update && | |
sudo apt upgrade -y && | |
sudo apt install -y wget gnupg lsb-release ca-certificates gpg software-properties-common apt-transport-https curl wget jq | |
- name: Download Release Artifact | |
env: | |
GHDL_TOKEN: ${{ secrets.GHDL_TOKEN }} | |
run: | | |
chmod +x ${{ github.workspace }}/.github/workflows/docker/download.sh | |
bash ${{ github.workspace }}/.github/workflows/docker/download.sh ${{ github.ref_name }} | |
- name: Build Docker Image | |
run: | | |
docker build \ | |
--file .github/workflows/docker/Dockerfile \ | |
--build-arg RELEASE_TAG=${{ github.ref_name }} \ | |
-t ${{ secrets.DOCKER_USERNAME }}/valhalla-server-run:latest . | |
docker tag ${{ secrets.DOCKER_USERNAME }}/valhalla-server-run:latest \ | |
${{ secrets.DOCKER_USERNAME }}/valhalla-server-run:${{ github.ref_name }} | |
- name: Push Docker Image | |
run: | | |
docker push ${{ secrets.DOCKER_USERNAME }}/valhalla-server-run:${{ github.ref_name }} | |
docker push ${{ secrets.DOCKER_USERNAME }}/valhalla-server-run:latest |