45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: container
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Git unshallow - get all history from Git to get the tag for the computation of the version
|
|
run: git pull --unshallow
|
|
|
|
- name: Get the version from git
|
|
id: version
|
|
run: echo "version=$(git describe --dirty --tags)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Workaround for bug of podman-login
|
|
run: |
|
|
mkdir -p $HOME/.docker
|
|
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
|
|
|
|
- name: Log in to the container registry (with another workaround)
|
|
uses: actions/podman-login@v1
|
|
with:
|
|
registry: ${{ vars.REGISTRY }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
auth_file_path: /tmp/auth.json
|
|
|
|
- name: Build the container image
|
|
uses: actions/buildah-build@v1
|
|
with:
|
|
image: treetrail-backend
|
|
oci: true
|
|
labels: treetrail-backend
|
|
tags: ${{ steps.version.outputs.version }}
|
|
containerfiles: |
|
|
./Containerfile
|
|
|
|
- name: Push the image to the registry
|
|
uses: actions/push-to-registry@v2
|
|
with:
|
|
registry: "docker://${{ vars.REGISTRY }}"
|
|
image: treetrail-backend
|
|
tags: ${{ steps.version.outputs.version }}
|