2024-10-25 14:03:43 +02:00
|
|
|
on:
|
2024-10-28 18:33:23 +01:00
|
|
|
workflow_dispatch:
|
2024-10-26 00:33:57 +02:00
|
|
|
|
2024-10-25 14:03:43 +02:00
|
|
|
jobs:
|
2024-11-03 02:18:01 +01:00
|
|
|
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
|
|
|
|
|
2024-10-29 04:07:43 +01:00
|
|
|
- name: Workaround for bug of podman-login
|
2024-10-29 04:09:46 +01:00
|
|
|
run: |
|
2024-11-01 13:59:33 +01:00
|
|
|
mkdir -p $HOME/.docker
|
2024-10-29 04:09:46 +01:00
|
|
|
echo "{ \"auths\": {} }" > $HOME/.docker/config.json
|
2024-10-29 04:07:43 +01:00
|
|
|
|
2024-11-02 05:30:27 +01:00
|
|
|
- name: Log in to the container registry (with another workaround)
|
2024-10-28 18:28:13 +01:00
|
|
|
uses: actions/podman-login@v1
|
2024-10-28 18:11:26 +01:00
|
|
|
with:
|
2024-10-28 18:40:34 +01:00
|
|
|
registry: ${{ vars.REGISTRY }}
|
2024-10-28 18:11:26 +01:00
|
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
2024-10-29 03:54:33 +01:00
|
|
|
auth_file_path: /tmp/auth.json
|
2024-10-28 18:11:26 +01:00
|
|
|
|
2024-11-03 04:11:35 +01:00
|
|
|
- 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
|
|
|
|
|
2024-11-02 05:30:27 +01:00
|
|
|
- name: Push the image to the registry
|
|
|
|
uses: actions/push-to-registry@v2
|
2024-10-25 14:03:43 +02:00
|
|
|
with:
|
2024-10-28 18:37:55 +01:00
|
|
|
registry: "docker://${{ vars.REGISTRY }}"
|
2024-10-27 02:09:13 +02:00
|
|
|
image: treetrail-backend
|
2024-11-03 02:18:01 +01:00
|
|
|
tags: ${{ steps.version.outputs.version }}
|