Switch to podman
This commit is contained in:
parent
269c65b8c2
commit
899c1efc15
1 changed files with 25 additions and 26 deletions
|
|
@ -12,33 +12,32 @@ jobs:
|
|||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Codeberg Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: codeberg.org
|
||||
username: ${{ secrets.CODEBERG_USERNAME }}
|
||||
password: ${{ secrets.CODEBERG_TOKEN }}
|
||||
run: |
|
||||
echo "${{ secrets.CODEBERG_TOKEN }}" | podman login --username "${{ secrets.CODEBERG_USERNAME }}" --password-stdin codeberg.org
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: codeberg.org/lvl0/incr
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=raw,value=latest
|
||||
- name: Extract version
|
||||
id: version
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "major_minor=$(echo $VERSION | cut -d. -f1-2)" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "version=latest" >> $GITHUB_OUTPUT
|
||||
echo "major_minor=latest" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||
podman build -f docker/Dockerfile -t codeberg.org/lvl0/incr:${{ steps.version.outputs.version }} .
|
||||
podman build -f docker/Dockerfile -t codeberg.org/lvl0/incr:${{ steps.version.outputs.major_minor }} .
|
||||
podman build -f docker/Dockerfile -t codeberg.org/lvl0/incr:latest .
|
||||
podman push codeberg.org/lvl0/incr:${{ steps.version.outputs.version }}
|
||||
podman push codeberg.org/lvl0/incr:${{ steps.version.outputs.major_minor }}
|
||||
podman push codeberg.org/lvl0/incr:latest
|
||||
else
|
||||
podman build -f docker/Dockerfile -t codeberg.org/lvl0/incr:latest .
|
||||
podman push codeberg.org/lvl0/incr:latest
|
||||
fi
|
||||
Loading…
Reference in a new issue