paramod-rust/.gitea/workflows/docker.yml

31 lines
1.0 KiB
YAML

name: Build Docker Image (Podman)
on:
push:
branches: [ main ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Podman
run: sudo apt-get update && sudo apt-get install -y podman
- name: Checkout code
uses: actions/checkout@v3
- name: Set version in Cargo.toml
run: |
VERSION=$(cat VERSION)
sed -i "s/^version = \"__VERSION__\"/version = \"$VERSION\"/" Cargo.toml
- name: Build image with Podman
run: |
VERSION=$(cat VERSION)
podman build -t paramod:latest -t git.skaville.rocks/eneuber/paramod:$VERSION .
- name: Login to Gitea Registry
run: echo ${{ secrets.REGISTRY_TOKEN }} | podman login -u ${{ secrets.USER }} --password-stdin git.skaville.rocks
- name: Push image with version
run: |
VERSION=$(cat VERSION)
podman push git.skaville.rocks/eneuber/paramod:$VERSION
- name: Push image latest
run: podman push git.skaville.rocks/eneuber/paramod:latest